logic: Fixed saving project name to ProjectSettings also sets project location to '/'

This commit is contained in:
Eberhard Graether
2017-06-19 23:38:39 +02:00
parent 05c2878eec
commit 652a55b4fb
5 changed files with 28 additions and 23 deletions
+11 -11
View File
@@ -46,7 +46,7 @@ ProjectSettings::ProjectSettings(const FilePath& projectFilePath)
ProjectSettings::ProjectSettings(std::string projectName, const FilePath& projectFileLocation)
{
setFilePath(FilePath(projectFileLocation.str() + "/" + projectName + PROJECT_FILE_EXTENSION));
setProjectFilePath(projectName, projectFileLocation);
}
ProjectSettings::~ProjectSettings()
@@ -105,26 +105,26 @@ bool ProjectSettings::reload()
return Settings::load(getFilePath());
}
FilePath ProjectSettings::getProjectFilePath() const
{
return getFilePath();
}
void ProjectSettings::setProjectFilePath(std::string projectName, const FilePath& projectFileLocation)
{
setFilePath(FilePath(projectFileLocation.str() + "/" + projectName + PROJECT_FILE_EXTENSION));
}
std::string ProjectSettings::getProjectName() const
{
return getFilePath().withoutExtension().fileName();
}
void ProjectSettings::setProjectName(const std::string& name)
{
setFilePath(FilePath(getProjectFileLocation().str() + "/" + name + PROJECT_FILE_EXTENSION));
}
FilePath ProjectSettings::getProjectFileLocation() const
{
return getFilePath().parentDirectory();
}
void ProjectSettings::setProjectFileLocation(const FilePath& location)
{
setFilePath(FilePath(location.str() + "/" + getProjectName() + PROJECT_FILE_EXTENSION));
}
std::string ProjectSettings::getDescription() const
{
return getValue<std::string>("description", "");