From e15f768a1538e558f95914d7786635eaf58847ad Mon Sep 17 00:00:00 2001 From: Al12rs Date: Thu, 13 Dec 2018 21:18:35 +0100 Subject: Fixed opening multiple modinfodialog from Open Origin info. --- src/mainwindow.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/mainwindow.cpp') 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 flags = modInfo->getFlags(); + ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(m_OrganizerCore.pluginList()->origin(fileName))); + std::vector 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) { -- cgit v1.3.1