diff options
| -rw-r--r-- | src/mainwindow.cpp | 11 | ||||
| -rw-r--r-- | src/profile.h | 7 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2e1391c1..2dbf297c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -6260,10 +6260,13 @@ void MainWindow::sendSelectedModsToPriority_clicked() void MainWindow::sendSelectedModsToSeparator_clicked()
{
QStringList separators;
- for (auto mod : m_OrganizerCore.modList()->allMods()) {
- ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(mod));
- if (modInfo->hasFlag(ModInfo::FLAG_SEPARATOR)) {
- separators << mod.chopped(10);
+ auto indexesByPriority = m_OrganizerCore.currentProfile()->getAllIndexesByPriority();
+ for (auto iter = indexesByPriority.begin(); iter != indexesByPriority.end(); iter++) {
+ if ((iter->second != UINT_MAX)) {
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(iter->second);
+ if (modInfo->hasFlag(ModInfo::FLAG_SEPARATOR)) {
+ separators << modInfo->name().chopped(10);
+ }
}
}
diff --git a/src/profile.h b/src/profile.h index a9d68062..95a5c59d 100644 --- a/src/profile.h +++ b/src/profile.h @@ -234,6 +234,13 @@ public: std::vector<std::tuple<QString, QString, int> > getActiveMods(); /** + * @brief retrieve a mod of the indexes ordered by priority + * + * @return map of indexes by priority + **/ + std::map<int, unsigned int> getAllIndexesByPriority() { return m_ModIndexByPriority; } + + /** * retrieve the number of mods for which this object has status information. * This is usually the same as ModInfo::getNumMods() except between * calls to ModInfo::updateFromDisc() and the Profile::refreshModStatus() |
