From 9ae442810b479dd61747fea03eceae500a6c2411 Mon Sep 17 00:00:00 2001 From: Silarn Date: Fri, 4 May 2018 19:00:55 -0500 Subject: Make sure to update the index when data is changed --- src/pluginlist.cpp | 6 ++++++ src/pluginlist.h | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index fe654c7e..a6ae8fa7 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -76,6 +76,7 @@ PluginList::PluginList(QObject *parent) : QAbstractItemModel(parent) , m_FontMetrics(QFont()) { + connect(this, SIGNAL(writePluginsList()), this, SLOT(generatePluginIndexes())); } PluginList::~PluginList() @@ -738,6 +739,11 @@ void PluginList::updateIndices() m_ESPsByPriority.at(static_cast(m_ESPs[i].m_Priority)) = i; } + generatePluginIndexes(); +} + +void PluginList::generatePluginIndexes() +{ int numESLs = 0; int numSkipped = 0; for (int l = 0; l < m_ESPs.size(); ++l) { diff --git a/src/pluginlist.h b/src/pluginlist.h index b3b0ee13..f6745aa8 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -257,6 +257,11 @@ public slots: */ void managedGameChanged(MOBase::IPluginGame const *gamePlugin); + /** + * @brief Generate the plugin indexes because something was changed + **/ + void generatePluginIndexes(); + signals: /** -- cgit v1.3.1