summaryrefslogtreecommitdiff
path: root/src/modlist.cpp
diff options
context:
space:
mode:
authorBrian Munro <brian.alexander.munro@gmail.com>2017-12-21 08:31:25 +0200
committerGitHub <noreply@github.com>2017-12-21 08:31:25 +0200
commit28a68cf51bab172e0efc460a94821692100dad00 (patch)
tree548012644d64aa6e450fafe0f812e0830239333a /src/modlist.cpp
parentb157ebb28c38a5ade879c0736a9dcb7fe0367a89 (diff)
parenta24a1cbf257f49fa31263e2f6115c378714a64d3 (diff)
Merge pull request #156 from erasmux/vs_usvfs_plus_various_fixes
Vs usvfs plus various fixes
Diffstat (limited to 'src/modlist.cpp')
-rw-r--r--src/modlist.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/modlist.cpp b/src/modlist.cpp
index 3afa94b5..046e2280 100644
--- a/src/modlist.cpp
+++ b/src/modlist.cpp
@@ -424,13 +424,13 @@ bool ModList::renameMod(int index, const QString &newName)
return false;
}
- // before we rename, write back the current profile so we don't lose changes and to ensure
- // there is no scheduled asynchronous rewrite anytime soon
- m_Profile->writeModlistNow();
-
ModInfo::Ptr modInfo = ModInfo::getByIndex(index);
QString oldName = modInfo->name();
- if (modInfo->setName(nameFixed)) {
+ if (newName != oldName && modInfo->setName(nameFixed)) {
+ // before we rename, write back the current profile so we don't lose changes and to ensure
+ // there is no scheduled asynchronous rewrite anytime soon
+ m_Profile->writeModlistNow();
+
// this just disabled the mod in all profiles. The recipient of modRenamed must fix that
emit modRenamed(oldName, nameFixed);
}
@@ -940,12 +940,12 @@ void ModList::removeRowForce(int row, const QModelIndex &parent)
m_Profile->setModEnabled(row, false);
- m_Profile->modlistWriter().cancel();
+ m_Profile->cancelModlistWrite();
beginRemoveRows(parent, row, row);
ModInfo::removeMod(row);
endRemoveRows();
m_Profile->refreshModStatus(); // removes the mod from the status list
- m_Profile->modlistWriter().write(); // this ensures the modified list gets written back before new mods can be installed
+ m_Profile->writeModlist(); // this ensures the modified list gets written back before new mods can be installed
if (wasEnabled) {
emit removeOrigin(modInfo->name());