summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorAl12rs <gabriel.cortesi@outlook.com>2018-12-13 21:18:35 +0100
committerAl12rs <gabriel.cortesi@outlook.com>2018-12-13 21:18:35 +0100
commite15f768a1538e558f95914d7786635eaf58847ad (patch)
tree9658264788bb8a7430b7daf6d2a3f5d996aba30f /src/mainwindow.cpp
parente63eba2ca1c0ac0d862275168157e9382f05a945 (diff)
Fixed opening multiple modinfodialog from Open Origin info.
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 931fa2af..9f9dc0fb 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -3227,7 +3227,9 @@ void MainWindow::openOriginInformation_clicked()
{
try {
QItemSelectionModel *selection = ui->espList->selectionModel();
- if (selection->hasSelection() && selection->selectedRows().count() > 0) {
+ //we don't want to open multiple modinfodialogs.
+ /*if (selection->hasSelection() && selection->selectedRows().count() > 0) {
+
for (QModelIndex idx : selection->selectedRows()) {
QString fileName = idx.data().toString();
ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
@@ -3238,16 +3240,15 @@ void MainWindow::openOriginInformation_clicked()
}
}
}
- else {
- QModelIndex idx = selection->currentIndex();
- QString fileName = idx.data().toString();
+ else {}*/
+ QModelIndex idx = selection->currentIndex();
+ QString fileName = idx.data().toString();
- ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
- std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
+ std::vector<ModInfo::EFlag> flags = modInfo->getFlags();
- if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) {
- displayModInformation(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
- }
+ if (modInfo->isRegular() || (std::find(flags.begin(), flags.end(), ModInfo::FLAG_OVERWRITE) != flags.end())) {
+ displayModInformation(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName)));
}
}
catch (const std::exception &e) {