src: Refactored SourceGroupSettings into components as bases architecture

This commit is contained in:
Eberhard Graether
2019-10-18 13:05:27 +02:00
parent 941e5dbcaa
commit bd09cc4feb
105 changed files with 1610 additions and 1827 deletions
@@ -0,0 +1,41 @@
#include "SourceGroupSettingsWithCxxCdbPath.h"
#include "ProjectSettings.h"
#include "utilityFile.h"
FilePath SourceGroupSettingsWithCxxCdbPath::getCompilationDatabasePath() const
{
return m_compilationDatabasePath;
}
FilePath SourceGroupSettingsWithCxxCdbPath::getCompilationDatabasePathExpandedAndAbsolute() const
{
return utility::getExpandedAndAbsolutePath(
getCompilationDatabasePath(), getProjectSettings()->getProjectDirectoryPath());
}
void SourceGroupSettingsWithCxxCdbPath::setCompilationDatabasePath(const FilePath& compilationDatabasePath)
{
m_compilationDatabasePath = compilationDatabasePath;
}
bool SourceGroupSettingsWithCxxCdbPath::equals(const SourceGroupSettingsBase* other) const
{
const SourceGroupSettingsWithCxxCdbPath* otherPtr =
dynamic_cast<const SourceGroupSettingsWithCxxCdbPath*>(other);
return (
otherPtr &&
m_compilationDatabasePath == otherPtr->m_compilationDatabasePath
);
}
void SourceGroupSettingsWithCxxCdbPath::load(const ConfigManager* config, const std::string& key)
{
setCompilationDatabasePath(config->getValueOrDefault(key + "/build_file_path/compilation_db_path", FilePath(L"")));
}
void SourceGroupSettingsWithCxxCdbPath::save(ConfigManager* config, const std::string& key)
{
config->setValue(key + "/build_file_path/compilation_db_path", getCompilationDatabasePath().wstr());
}