diff options
| author | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-08-29 19:35:41 +0200 |
|---|---|---|
| committer | Mikaël Capelle <capelle.mikael@gmail.com> | 2020-08-29 19:35:41 +0200 |
| commit | 3729f18af1ee2a84756eb729e2f2b8343c51c24a (patch) | |
| tree | b03b2d98dfdda0c19de1626d06dbe34c5407600f /src/modlist.cpp | |
| parent | fd86000f1e6a5691d23a2faa71f8d0773a425fee (diff) | |
Update for change to onModStateChanged.
Diffstat (limited to 'src/modlist.cpp')
| -rw-r--r-- | src/modlist.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp index c772f5bd..cbd9f30c 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -822,7 +822,7 @@ void ModList::modInfoChanged(ModInfo::Ptr info) if (info->name() == m_ChangeInfo.name) { IModList::ModStates newState = state(info->name()); if (m_ChangeInfo.state != newState) { - m_ModStateChanged(info->name(), newState); + m_ModStateChanged({ {info->name(), newState} }); } int row = ModInfo::getIndex(info->name()); @@ -1001,17 +1001,20 @@ bool ModList::setPriority(const QString &name, int newPriority) } } -bool ModList::onModStateChanged(const std::function<void (const QString &, IModList::ModStates)> &func) +bool ModList::onModStateChanged(const std::function<void(const std::map<QString, ModStates>&)>& func) { auto conn = m_ModStateChanged.connect(func); return conn.connected(); } -void ModList::notifyModStateChanged(QList<unsigned int> modIndices) const { +void ModList::notifyModStateChanged(QList<unsigned int> modIndices) const +{ + std::map<QString, ModStates> mods; for (auto modIndex : modIndices) { ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex); - m_ModStateChanged(modInfo->name(), state(modIndex)); + mods.emplace(modInfo->name(), state(modIndex)); } + m_ModStateChanged(mods); } bool ModList::onModMoved(const std::function<void (const QString &, int, int)> &func) |
