build: deploy changes
* moved sample projects from data to user folder * added fallback files for app and window settings * implemented copying app and window settings to user folder when not found on app startup * fixed upgrading for windows installer
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "utility/ResourcePaths.h"
|
||||
#include "utility/Status.h"
|
||||
#include "utility/utility.h"
|
||||
#include "utility/UserPaths.h"
|
||||
|
||||
const size_t ApplicationSettings::VERSION = 1;
|
||||
|
||||
@@ -307,7 +308,14 @@ std::vector<FilePath> ApplicationSettings::getRecentProjects() const
|
||||
|
||||
for (FilePath project: loadedRecentProjects)
|
||||
{
|
||||
if (project.isAbsolute())
|
||||
{
|
||||
recentProjects.push_back(project);
|
||||
}
|
||||
else
|
||||
{
|
||||
recentProjects.push_back(UserPaths::getSampleProjectsPath() + project.str());
|
||||
}
|
||||
}
|
||||
return recentProjects;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "utility/UserPaths.h"
|
||||
|
||||
std::string UserPaths::s_userDataPath = "";
|
||||
std::string UserPaths::s_sampleProjectsPath = "";
|
||||
|
||||
std::string UserPaths::getUserDataPath()
|
||||
{
|
||||
@@ -12,6 +13,21 @@ void UserPaths::setUserDataPath(const std::string& path)
|
||||
s_userDataPath = path;
|
||||
}
|
||||
|
||||
std::string UserPaths::getSampleProjectsPath()
|
||||
{
|
||||
if (s_sampleProjectsPath.size())
|
||||
{
|
||||
return s_sampleProjectsPath;
|
||||
}
|
||||
|
||||
return s_userDataPath;
|
||||
}
|
||||
|
||||
void UserPaths::setSampleProjectsPath(const std::string& path)
|
||||
{
|
||||
s_sampleProjectsPath = path;
|
||||
}
|
||||
|
||||
std::string UserPaths::getAppSettingsPath()
|
||||
{
|
||||
return getUserDataPath() + "ApplicationSettings.xml";
|
||||
|
||||
@@ -9,12 +9,16 @@ public:
|
||||
static std::string getUserDataPath();
|
||||
static void setUserDataPath(const std::string& path);
|
||||
|
||||
static std::string getSampleProjectsPath();
|
||||
static void setSampleProjectsPath(const std::string& path);
|
||||
|
||||
static std::string getAppSettingsPath();
|
||||
static std::string getWindowSettingsPath();
|
||||
static std::string getLogPath();
|
||||
|
||||
private:
|
||||
static std::string s_userDataPath;
|
||||
static std::string s_sampleProjectsPath;
|
||||
};
|
||||
|
||||
#endif // USER_PATHS_H
|
||||
|
||||
Reference in New Issue
Block a user