diff options
| author | Tannin <devnull@localhost> | 2014-05-05 18:24:15 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-05-05 18:24:15 +0200 |
| commit | 0eb1662a0eaf8eee680cab5b913fff3fcc9b8b2f (patch) | |
| tree | 4cccf64266f73d9acabc15e517abd510da79b582 /src/pluginlist.cpp | |
| parent | 164ec25a75a9d5b5fcbafbe321935ba37fe0885c (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/pluginlist.cpp')
| -rw-r--r-- | src/pluginlist.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 534017cd..929e0476 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -391,6 +391,8 @@ void PluginList::writePlugins(const QString &fileName, bool writeUnchecked) cons file->write(textCodec->fromUnicode("# This file was automatically generated by Mod Organizer.\r\n")); + QStringList saveList; + bool invalidFileNames = false; int writtenCount = 0; for (size_t i = 0; i < m_ESPs.size(); ++i) { @@ -401,6 +403,7 @@ void PluginList::writePlugins(const QString &fileName, bool writeUnchecked) cons invalidFileNames = true; qCritical("invalid plugin name %s", m_ESPs[priority].m_Name.toUtf8().constData()); } else { + saveList << m_ESPs[priority].m_Name; file->write(textCodec->fromUnicode(m_ESPs[priority].m_Name)); } file->write("\r\n"); @@ -413,9 +416,9 @@ void PluginList::writePlugins(const QString &fileName, bool writeUnchecked) cons "Please see mo_interface.log for a list of affected plugins and rename them.")); } - file.commit(); - - qDebug("%s saved", QDir::toNativeSeparators(fileName).toUtf8().constData()); + if (file.commitIfDifferent(m_LastSaveHash[fileName])) { + qDebug("%s saved", QDir::toNativeSeparators(fileName).toUtf8().constData()); + } } |
