ui: Fixed path checking in project setup wizzard
This commit is contained in:
@@ -225,24 +225,24 @@ void ProjectSettings::setProjectName(const std::string& name)
|
||||
m_projectName = name;
|
||||
}
|
||||
|
||||
std::string ProjectSettings::getProjectFileLocation() const
|
||||
FilePath ProjectSettings::getProjectFileLocation() const
|
||||
{
|
||||
if (m_projectFileLocation.size())
|
||||
if (!m_projectFileLocation.empty())
|
||||
{
|
||||
return m_projectFileLocation;
|
||||
}
|
||||
|
||||
return getFilePath().parentDirectory().str();
|
||||
return getFilePath().parentDirectory();
|
||||
}
|
||||
|
||||
void ProjectSettings::setProjectFileLocation(const std::string& location)
|
||||
void ProjectSettings::setProjectFileLocation(const FilePath& location)
|
||||
{
|
||||
m_projectFileLocation = location;
|
||||
}
|
||||
|
||||
void ProjectSettings::makePathsAbsolute(std::vector<FilePath>& paths) const
|
||||
{
|
||||
FilePath basePath = getFilePath().parentDirectory();
|
||||
FilePath basePath = getProjectFileLocation();
|
||||
for (size_t i = 0; i < paths.size(); i++)
|
||||
{
|
||||
if (!paths[i].isAbsolute())
|
||||
|
||||
@@ -67,14 +67,14 @@ public:
|
||||
std::string getProjectName() const;
|
||||
void setProjectName(const std::string& name);
|
||||
|
||||
std::string getProjectFileLocation() const;
|
||||
void setProjectFileLocation(const std::string& location);
|
||||
FilePath getProjectFileLocation() const;
|
||||
void setProjectFileLocation(const FilePath& location);
|
||||
|
||||
private:
|
||||
void makePathsAbsolute(std::vector<FilePath>& paths) const;
|
||||
|
||||
std::string m_projectName;
|
||||
std::string m_projectFileLocation;
|
||||
FilePath m_projectFileLocation;
|
||||
|
||||
static std::shared_ptr<ProjectSettings> s_instance;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user