summaryrefslogtreecommitdiff
path: root/src/profile.cpp
diff options
context:
space:
mode:
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 958084d7..6e9d8f0f 100644
--- a/src/profile.cpp
+++ b/src/profile.cpp
@@ -217,7 +217,7 @@ void Profile::createTweakedIniFile()
}
if (localSavesEnabled()) {
- if (!::WritePrivateProfileStringW(L"General", L"bUseMyGamesDirectory", L"1", ToWString(tweakedIni).c_str())) {
+ if (!::WritePrivateProfileStringW(L"General", L"bUseMyGamesDirectory", L"0", ToWString(tweakedIni).c_str())) {
error = true;
}
@@ -238,7 +238,7 @@ void Profile::createTweakedIniFile()
void Profile::refreshModStatus()
{
QFile file(getModlistFileName());
- if (!file.exists()) {
+ if (!file.open(QIODevice::ReadOnly)) {
throw MyException(tr("\"%1\" is missing or inaccessible").arg(getModlistFileName()));
}
@@ -249,10 +249,9 @@ void Profile::refreshModStatus()
std::set<QString> namesRead;
// load mods from file and update enabled state and priority for them
- file.open(QIODevice::ReadOnly);
int index = 0;
while (!file.atEnd()) {
- QByteArray line = file.readLine();
+ QByteArray line = file.readLine().trimmed();
bool enabled = true;
QString modName;
if (line.length() == 0) {