summaryrefslogtreecommitdiff
path: root/src/profile.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2014-05-05 18:24:15 +0200
committerTannin <devnull@localhost>2014-05-05 18:24:15 +0200
commit0eb1662a0eaf8eee680cab5b913fff3fcc9b8b2f (patch)
tree4cccf64266f73d9acabc15e517abd510da79b582 /src/profile.cpp
parent164ec25a75a9d5b5fcbafbe321935ba37fe0885c (diff)
- very effective optimization to findfirstfile-calls
- several configuration files are now only saved to disk if the content actually changed. This should also get rid of a problem where plugins.txt was re-written immediately after starting the game (causing a conflict with the game) - reduced "noise" from hook.dll - removed some debugging messages
Diffstat (limited to 'src/profile.cpp')
-rw-r--r--src/profile.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/profile.cpp b/src/profile.cpp
index 42358b7d..8d02c047 100644
--- a/src/profile.cpp
+++ b/src/profile.cpp
@@ -147,7 +147,6 @@ void Profile::writeModlistNow(bool onlyOnTimer) const
m_SaveTimer->stop();
if (!m_Directory.exists()) return;
-#pragma message("right now, this is doing unnecessary saves. Need a flag that says that mod priority, enabled-state or name of a mod has changed")
try {
QString fileName = getModlistFileName();
@@ -175,9 +174,9 @@ void Profile::writeModlistNow(bool onlyOnTimer) const
}
}
- file.commit();
-
- qDebug("%s saved", QDir::toNativeSeparators(fileName).toUtf8().constData());
+ if (file.commitIfDifferent(m_LastModlistHash)) {
+ qDebug("%s saved", QDir::toNativeSeparators(fileName).toUtf8().constData());
+ }
} catch (const std::exception &e) {
reportError(tr("failed to write mod list: %1").arg(e.what()));
return;