X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;f=src%2Flibs%2FCommon%2Finifile.cpp;h=14a47ee5fda19cb3c82b2bdbab383f13cfe3d9a6;hb=0957525838e501a4609a15b8d7a765da43362025;hp=28e700f33c5b1c199cefbd44f94b459bcf77cd05;hpb=6230ebd0a05134031e52001c15473c3c3e6c7c1b;p=evaf
diff --git a/src/libs/Common/inifile.cpp b/src/libs/Common/inifile.cpp
index 28e700f..14a47ee 100644
--- a/src/libs/Common/inifile.cpp
+++ b/src/libs/Common/inifile.cpp
@@ -231,6 +231,7 @@ QExplicitlySharedDataPointer IniFileImpl::getParameter(QFile & fil
valueObject = new IniFileValue(currentPos);
valueObject->name = name;
valueObject->paramValue = value;
+ valueObject->thisOsOnly = thisOsOnly;
section.values.insert(name, valueObject);
}
else {
@@ -238,6 +239,7 @@ QExplicitlySharedDataPointer IniFileImpl::getParameter(QFile & fil
valueObject = *it;
valueObject->name = name;
valueObject->paramValue = value;
+ valueObject->thisOsOnly = thisOsOnly;
}
// Is this the parameter vwe are looking for?
@@ -257,7 +259,7 @@ QExplicitlySharedDataPointer IniFileImpl::getParameter(QFile & fil
QVariant IniFileImpl::getValue(QString const & paramName, QVariant const & defaultValue)
{
// Locate the '/' character that separates section names from key names
- int idx = paramName.indexOf('/');
+ int idx = paramName.lastIndexOf('/');
if (idx < 0)
return defaultValue;
@@ -293,7 +295,7 @@ QVariant IniFileImpl::getValue(QString const & paramName, QVariant const & defau
bool IniFileImpl::setValue(QString const & paramName, QVariant const & value)
{
// Locate the '/' character that separates section names from key names
- int idx = paramName.indexOf('/');
+ int idx = paramName.lastIndexOf('/', -1);
if (idx < 0)
return false;
@@ -392,7 +394,7 @@ bool IniFileImpl::setValue(QString const & paramName, QVariant const & value)
#ifdef Q_OS_LINUX
prefix = "linux:";
#endif
-#if Q_OS_WIN32
+#ifdef Q_OS_WIN32
prefix = "windows:";
#endif
}
@@ -455,6 +457,9 @@ bool IniFileImpl::setValue(QString const & paramName, QVariant const & value)
if (diff)
updateCache(currentPos, diff);
+ // Update the parameter value in the internal cache
+ valueObject->paramValue = valueString;
+
}
f.close();