From 3729f18af1ee2a84756eb729e2f2b8343c51c24a Mon Sep 17 00:00:00 2001 From: Mikaƫl Capelle Date: Sat, 29 Aug 2020 19:35:41 +0200 Subject: Update for change to onModStateChanged. --- src/modlist.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/modlist.cpp') 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 &func) +bool ModList::onModStateChanged(const std::function&)>& func) { auto conn = m_ModStateChanged.connect(func); return conn.connected(); } -void ModList::notifyModStateChanged(QList modIndices) const { +void ModList::notifyModStateChanged(QList modIndices) const +{ + std::map 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 &func) -- cgit v1.3.1