ui: Refactored QtCodeSnippet and added view settings to ApplicationSettings

This change refactors parts of the QtCodeSnippet and places some settings into ApplicationSettings.
Additionally Application- and ProjectSettings were abstracted to the common base class Settings, which takes care of the
getting and setting values of the Configmanager member.
This commit is contained in:
Eberhard Graether
2014-07-03 16:10:55 +02:00
parent 4ae6f4a04a
commit 042a508422
15 changed files with 254 additions and 125 deletions
+41
View File
@@ -0,0 +1,41 @@
#include "Settings.h"
#include "utility/FileSystem.h"
#include "utility/logging/logging.h"
#include "utility/text/TextAccess.h"
Settings::Settings()
{
}
Settings::~Settings()
{
}
bool Settings::load(const std::string& filePath)
{
m_config.reset();
if (FileSystem::exists(filePath))
{
m_config = ConfigManager::createAndLoad(TextAccess::createFromFile(filePath));
return true;
}
else
{
LOG_WARNING("File for Settings not found.");
return false;
}
}
void Settings::save(const std::string& filePath)
{
if (m_config)
{
m_config->save();
}
else
{
LOG_WARNING("Settings were not saved.");
}
}