mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +02:00
configfile: set the modified flag correctly on set*Vector methods
Origin commit data
------------------
Branch: ni/coolstream
Commit: 07a8027b4d
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-02-23 (Sat, 23 Feb 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
committed by
Jacek Jendrzej
parent
32b4ee678f
commit
c63da7e9a9
@@ -387,6 +387,9 @@ void CConfigFile::setString(const std::string & key, const std::string & val)
|
||||
|
||||
void CConfigFile::setInt32Vector(const std::string & key, const std::vector<int32_t> vec)
|
||||
{
|
||||
bool tmpUnknownKeyQueryedFlag = unknownKeyQueryedFlag;
|
||||
unknownKeyQueryedFlag = false;
|
||||
std::string oldVal = getString(key);
|
||||
std::stringstream s;
|
||||
|
||||
for (std::vector<int32_t>::const_iterator it = vec.begin(); ; )
|
||||
@@ -399,21 +402,35 @@ void CConfigFile::setInt32Vector(const std::string & key, const std::vector<int3
|
||||
break;
|
||||
s << delimiter;
|
||||
}
|
||||
s >> configData[key];
|
||||
if (oldVal != s.str() || unknownKeyQueryedFlag)
|
||||
{
|
||||
modifiedFlag = true;
|
||||
configData[key] = s.str();
|
||||
}
|
||||
unknownKeyQueryedFlag = tmpUnknownKeyQueryedFlag;
|
||||
}
|
||||
|
||||
void CConfigFile::setStringVector(const std::string & key, const std::vector<std::string> vec)
|
||||
{
|
||||
configData[key] = "";
|
||||
bool tmpUnknownKeyQueryedFlag = unknownKeyQueryedFlag;
|
||||
unknownKeyQueryedFlag = false;
|
||||
std::string oldVal = getString(key);
|
||||
std::string newVal = "";
|
||||
|
||||
for (std::vector<std::string>::const_iterator it = vec.begin(); ; )
|
||||
{
|
||||
if (it == vec.end())
|
||||
break;
|
||||
configData[key] += *it;
|
||||
newVal += *it;
|
||||
++it;
|
||||
if (it == vec.end())
|
||||
break;
|
||||
configData[key] += delimiter;
|
||||
newVal += delimiter;
|
||||
}
|
||||
if (oldVal != newVal || unknownKeyQueryedFlag)
|
||||
{
|
||||
modifiedFlag = true;
|
||||
configData[key] = newVal;
|
||||
}
|
||||
unknownKeyQueryedFlag = tmpUnknownKeyQueryedFlag;
|
||||
}
|
||||
|
Reference in New Issue
Block a user