This commit is contained in:
@@ -50,28 +50,32 @@ bool Settings::loadFromString(const std::string& text, bool readOnly)
|
||||
return true;
|
||||
}
|
||||
|
||||
void Settings::save()
|
||||
bool Settings::save()
|
||||
{
|
||||
if (m_readOnly)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool success = false;
|
||||
if (m_config.get() && !m_filePath.empty())
|
||||
{
|
||||
m_config->save(m_filePath.str());
|
||||
success = m_config->save(m_filePath.str());
|
||||
}
|
||||
else
|
||||
|
||||
if (!success)
|
||||
{
|
||||
LOG_WARNING(L"Settings were not saved: " + m_filePath.wstr());
|
||||
}
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
void Settings::save(const FilePath& filePath)
|
||||
bool Settings::save(const FilePath& filePath)
|
||||
{
|
||||
setFilePath(filePath);
|
||||
|
||||
save();
|
||||
return save();
|
||||
}
|
||||
|
||||
void Settings::clear()
|
||||
|
||||
@@ -19,8 +19,8 @@ public:
|
||||
|
||||
bool load(const FilePath& filePath, bool readOnly = false);
|
||||
bool loadFromString(const std::string& text, bool readOnly = false);
|
||||
void save();
|
||||
void save(const FilePath& filePath);
|
||||
bool save();
|
||||
bool save(const FilePath& filePath);
|
||||
|
||||
void clear();
|
||||
|
||||
|
||||
@@ -375,10 +375,10 @@ bool ConfigManager::load(const std::shared_ptr<TextAccess> textAccess)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ConfigManager::save(const std::string filepath)
|
||||
bool ConfigManager::save(const std::string filepath)
|
||||
{
|
||||
std::string output("");
|
||||
createXmlDocument(true, filepath, output);
|
||||
return createXmlDocument(true, filepath, output);
|
||||
}
|
||||
|
||||
void ConfigManager::setWarnOnEmptyKey(bool warnOnEmptyKey) const
|
||||
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
std::vector<std::string> getSublevelKeys(const std::string& key) const;
|
||||
|
||||
bool load(const std::shared_ptr<TextAccess> textAccess);
|
||||
void save(const std::string filepath);
|
||||
bool save(const std::string filepath);
|
||||
std::string toString();
|
||||
|
||||
void setWarnOnEmptyKey(bool warnOnEmptyKey) const;
|
||||
|
||||
Reference in New Issue
Block a user