build: split user and data folder, moving user data to Application Support on Mac
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "utility/messaging/type/MessageActivateNodes.h"
|
||||
#include "utility/messaging/type/MessageStatus.h"
|
||||
#include "utility/scheduling/TaskScheduler.h"
|
||||
#include "utility/UserPaths.h"
|
||||
#include "utility/Version.h"
|
||||
|
||||
#include "component/view/GraphViewStyle.h"
|
||||
@@ -15,8 +16,6 @@
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
|
||||
std::string Application::m_appSettingsPath = "data/ApplicationSettings.xml";
|
||||
|
||||
std::shared_ptr<Application> Application::create(
|
||||
const Version& version, ViewFactory* viewFactory, NetworkFactory* networkFactory
|
||||
){
|
||||
@@ -53,7 +52,7 @@ std::shared_ptr<Application> Application::create(
|
||||
|
||||
void Application::loadSettings()
|
||||
{
|
||||
ApplicationSettings::getInstance()->load(FilePath(m_appSettingsPath));
|
||||
ApplicationSettings::getInstance()->load(FilePath(UserPaths::getAppSettingsPath()));
|
||||
ColorScheme::getInstance()->load(ApplicationSettings::getInstance()->getColorSchemePath());
|
||||
|
||||
GraphViewStyle::loadStyleSettings();
|
||||
@@ -114,11 +113,6 @@ void Application::showLicenseScreen()
|
||||
m_mainView->showLicenseScreen();
|
||||
}
|
||||
|
||||
void Application::setAppSettingsPath(const std::string& appSettingsPath)
|
||||
{
|
||||
m_appSettingsPath = appSettingsPath;
|
||||
}
|
||||
|
||||
void Application::handleMessage(MessageActivateWindow* message)
|
||||
{
|
||||
m_mainView->activateWindow();
|
||||
@@ -187,5 +181,5 @@ void Application::updateRecentProjects(const FilePath& projectSettingsFilePath)
|
||||
}
|
||||
|
||||
appSettings->setRecentProjects(recentProjects);
|
||||
appSettings->save(m_appSettingsPath);
|
||||
appSettings->save(UserPaths::getAppSettingsPath());
|
||||
}
|
||||
|
||||
@@ -37,8 +37,6 @@ public:
|
||||
void saveProject(const FilePath& projectSettingsFilePath);
|
||||
void showLicenseScreen();
|
||||
|
||||
static void setAppSettingsPath(const std::string& appSettingsPath);
|
||||
|
||||
private:
|
||||
Application();
|
||||
|
||||
@@ -59,8 +57,6 @@ private:
|
||||
std::shared_ptr<ComponentManager> m_componentManager;
|
||||
|
||||
std::shared_ptr<IDECommunicationController> m_ideCommunicationController;
|
||||
|
||||
static std::string m_appSettingsPath;
|
||||
};
|
||||
|
||||
#endif // APPLICATION_H
|
||||
|
||||
@@ -294,6 +294,8 @@ add_files(
|
||||
utility/TimePoint.cpp
|
||||
utility/TimePoint.h
|
||||
utility/types.h
|
||||
utility/UserPaths.cpp
|
||||
utility/UserPaths.h
|
||||
utility/utility.cpp
|
||||
utility/utility.h
|
||||
utility/utilityString.cpp
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
// #include "src\lib_gui\includes.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOMINMAX
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
#include "utility/UserPaths.h"
|
||||
|
||||
std::string UserPaths::s_userDataPath = "user/";
|
||||
|
||||
std::string UserPaths::getUserDataPath()
|
||||
{
|
||||
return s_userDataPath;
|
||||
}
|
||||
|
||||
void UserPaths::setUserDataPath(const std::string& path)
|
||||
{
|
||||
s_userDataPath = path;
|
||||
}
|
||||
|
||||
std::string UserPaths::getAppSettingsPath()
|
||||
{
|
||||
return getUserDataPath() + "ApplicationSettings.xml";
|
||||
}
|
||||
|
||||
std::string UserPaths::getWindowSettingsPath()
|
||||
{
|
||||
return getUserDataPath() + "window_settings.ini";
|
||||
}
|
||||
|
||||
std::string UserPaths::getLogPath()
|
||||
{
|
||||
return getUserDataPath() + "log/";
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef USER_PATHS_H
|
||||
#define USER_PATHS_H
|
||||
|
||||
#include <string>
|
||||
|
||||
class UserPaths
|
||||
{
|
||||
public:
|
||||
static std::string getUserDataPath();
|
||||
static void setUserDataPath(const std::string& path);
|
||||
|
||||
static std::string getAppSettingsPath();
|
||||
static std::string getWindowSettingsPath();
|
||||
static std::string getLogPath();
|
||||
|
||||
private:
|
||||
static std::string s_userDataPath;
|
||||
};
|
||||
|
||||
#endif // USER_PATHS_H
|
||||
Reference in New Issue
Block a user