summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2018-12-26 16:18:52 -0600
committerLostDragonist <lost.dragonist@gmail.com>2018-12-26 17:23:12 -0600
commita3110731ca275b857eb264d69996264be5e404f5 (patch)
treefdd721f086d47224c7cef1b2cf56380a313cbb90 /src
parent6a4e52f9dc9e929f3404145702e8279eb19beae0 (diff)
Use WriteRegistryValue function to handle read-only files
Diffstat (limited to 'src')
-rw-r--r--src/profile.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/profile.cpp b/src/profile.cpp
index d65ea255..d1741311 100644
--- a/src/profile.cpp
+++ b/src/profile.cpp
@@ -29,6 +29,8 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include <safewritefile.h>
#include <bsainvalidation.h>
#include <dataarchives.h>
+#include "util.h"
+#include "registry.h"
#include <QApplication>
#include <QFile> // for QFile
@@ -279,7 +281,7 @@ void Profile::createTweakedIniFile()
mergeTweak(getProfileTweaks(), tweakedIni);
bool error = false;
- if (!::WritePrivateProfileStringW(L"Archive", L"bInvalidateOlderFiles", L"1", ToWString(tweakedIni).c_str())) {
+ if (!MOBase::WriteRegistryValue(L"Archive", L"bInvalidateOlderFiles", L"1", ToWString(tweakedIni).c_str())) {
error = true;
}
@@ -681,7 +683,7 @@ void Profile::mergeTweak(const QString &tweakName, const QString &tweakedIni) co
//TODO this treats everything as strings but how could I differentiate the type?
::GetPrivateProfileStringW(iter->c_str(), keyIter->c_str(),
nullptr, buffer.data(), bufferSize, ToWString(tweakName).c_str());
- ::WritePrivateProfileStringW(iter->c_str(), keyIter->c_str(),
+ MOBase::WriteRegistryValue(iter->c_str(), keyIter->c_str(),
buffer.data(), tweakedIniW.c_str());
}
}