X-Git-Url: https://vaikene.ee/gitweb/highlight.css?a=blobdiff_plain;f=src%2Flibs%2FCommon%2Finifile.cpp;h=2b21d551e40bbe4fe18885004ea7efda588b1fed;hb=555fa9e86134fda6e631e9178e50b444b1079e4f;hp=28e700f33c5b1c199cefbd44f94b459bcf77cd05;hpb=6230ebd0a05134031e52001c15473c3c3e6c7c1b;p=evaf diff --git a/src/libs/Common/inifile.cpp b/src/libs/Common/inifile.cpp index 28e700f..2b21d55 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; @@ -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();