diff options
| author | Seth Riley <17361645+Qudix@users.noreply.github.com> | 2020-11-03 18:38:45 -0600 |
|---|---|---|
| committer | Seth Riley <17361645+Qudix@users.noreply.github.com> | 2020-11-03 18:38:45 -0600 |
| commit | 34e1d05c28bf4676ed8d3e97e969187a05d215b6 (patch) | |
| tree | 285a418b970ba5daacf0c307cb98ed59fd31cda1 /src/modlist.cpp | |
| parent | 68750575d2f28c873b0d68391a7940e61c2ad2d4 (diff) | |
| parent | a7d4f2a0c40d35d547e93994be3f92b6d43a0833 (diff) | |
Merge branch 'master' of https://github.com/ModOrganizer2/modorganizer into master
Diffstat (limited to 'src/modlist.cpp')
| -rw-r--r-- | src/modlist.cpp | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp index f4c034dc..1f845999 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -854,25 +854,15 @@ void ModList::highlightMods(const QItemSelectionModel *selection, const MOShared ModInfo::getByIndex(i)->setPluginSelected(false); } for (QModelIndex idx : selection->selectedRows(PluginList::COL_NAME)) { - QString modName = idx.data().toString(); + QString pluginName = idx.data().toString(); - const MOShared::FileEntryPtr fileEntry = directoryEntry.findFile(modName.toStdWString()); + const MOShared::FileEntryPtr fileEntry = directoryEntry.findFile(pluginName.toStdWString()); if (fileEntry.get() != nullptr) { - bool archive = false; - std::vector<std::pair<int, std::pair<std::wstring, int>>> origins; - { - std::vector<std::pair<int, std::pair<std::wstring, int>>> alternatives = fileEntry->getAlternatives(); - origins.insert(origins.end(), std::pair<int, std::pair<std::wstring, int>>(fileEntry->getOrigin(archive), fileEntry->getArchive())); - } - for (auto originInfo : origins) { - MOShared::FilesOrigin& origin = directoryEntry.getOriginByID(originInfo.first); - for (unsigned int i = 0; i < ModInfo::getNumMods(); ++i) { - if (ModInfo::getByIndex(i)->internalName() == QString::fromStdWString(origin.getName())) { - ModInfo::getByIndex(i)->setPluginSelected(true); - break; - } - } - } + + QString originName = QString::fromStdWString(directoryEntry.getOriginByID(fileEntry->getOrigin()).getName()); + + auto modInfo = ModInfo::getByName(originName); + modInfo->setPluginSelected(true); } } notifyChange(0, rowCount() - 1); |
