diff options
| author | Tannin <devnull@localhost> | 2014-02-02 00:09:03 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-02-02 00:09:03 +0100 |
| commit | 48704877ca1dc44b9215ec834e93f34fd953b2fb (patch) | |
| tree | db680a70dceb6ac3317eaa32dc6f2a312d8a8665 /src/pluginlist.cpp | |
| parent | 48c944c737a0e277c3ac85c10008031f39cbc04c (diff) | |
- bugfix: upon moving files between mods, an attempt was made to access origins
for both, even if one (or both) mods weren't active
- bugfix: plugin-list should now deal with nested "layoutAboutToBeChanged" calls
gracefully. May be the reason of a bug.
Diffstat (limited to 'src/pluginlist.cpp')
| -rw-r--r-- | src/pluginlist.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index e04b8bb0..f5e0f1eb 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -132,7 +132,8 @@ void PluginList::refresh(const QString &profileName, const DirectoryEntry &baseD const QString &pluginsFile, const QString &loadOrderFile, const QString &lockedOrderFile) { - emit layoutAboutToBeChanged(); + ChangeBracket<PluginList> layoutChange(this); + m_ESPsByName.clear(); m_ESPsByPriority.clear(); m_ESPs.clear(); @@ -213,7 +214,8 @@ void PluginList::refresh(const QString &profileName, const DirectoryEntry &baseD readLockedOrderFrom(lockedOrderFile); - emit layoutChanged(); + layoutChange.finish(); + refreshLoadOrder(); emit dataChanged(this->index(0, 0), this->index(m_ESPs.size(), columnCount())); @@ -557,7 +559,7 @@ void PluginList::syncLoadOrder() void PluginList::refreshLoadOrder() { - emit layoutAboutToBeChanged(); + ChangeBracket<PluginList> layoutChange(this); syncLoadOrder(); // set priorities according to locked load order std::map<int, QString> lockedLoadOrder; @@ -593,7 +595,6 @@ void PluginList::refreshLoadOrder() } } } - emit layoutChanged(); } @@ -748,7 +749,7 @@ void PluginList::bossSort() qDebug("%d sorted, %d unrecognized", sizeSorted, sizeUnrecognized); - emit layoutAboutToBeChanged(); + ChangeBracket<PluginList> layoutChange(this); int priority = 0; applyBOSSSorting(sortedPlugins, sizeSorted, priority, true, "esm"); @@ -758,7 +759,7 @@ void PluginList::bossSort() // inform view of the changed data updateIndices(); - emit layoutChanged(); + layoutChange.finish(); syncLoadOrder(); emit dataChanged(this->index(0, 0), this->index(m_ESPs.size(), columnCount())); @@ -1089,7 +1090,7 @@ void PluginList::setPluginPriority(int row, int &newPriority) void PluginList::changePluginPriority(std::vector<int> rows, int newPriority) { - emit layoutAboutToBeChanged(); + ChangeBracket<PluginList> layoutChange(this); // sort rows to insert by their old priority (ascending) and insert them move them in that order const std::vector<ESPInfo> &esp = m_ESPs; std::sort(rows.begin(), rows.end(), @@ -1111,7 +1112,7 @@ void PluginList::changePluginPriority(std::vector<int> rows, int newPriority) setPluginPriority(*iter, newPriority); } - emit layoutChanged(); + layoutChange.finish(); refreshLoadOrder(); startSaveTime(); |
