logic: Fixed saving project name to ProjectSettings also sets project location to '/'
This commit is contained in:
@@ -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", "");
|
||||
|
||||
@@ -29,11 +29,11 @@ public:
|
||||
|
||||
bool reload();
|
||||
|
||||
std::string getProjectName() const;
|
||||
void setProjectName(const std::string& name);
|
||||
FilePath getProjectFilePath() const;
|
||||
void setProjectFilePath(std::string projectName, const FilePath& projectFileLocation);
|
||||
|
||||
std::string getProjectName() const;
|
||||
FilePath getProjectFileLocation() const;
|
||||
void setProjectFileLocation(const FilePath& location);
|
||||
|
||||
std::string getDescription() const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user