build: split user and data folder, moving user data to Application Support on Mac

This commit is contained in:
Eberhard Graether
2016-02-16 16:44:42 +01:00
parent 89b8d51ab8
commit 86cf1ee62d
51 changed files with 176 additions and 1809 deletions
+19 -3
View File
@@ -4,10 +4,10 @@
#include <CoreFoundation/CoreFoundation.h>
#include <QApplication>
#include <QDir>
#include <QStandardPaths>
static std::string appSettingsPath = "data/ApplicationSettings.xml";
static std::string windowSettingsPath = "data/window_settings.ini";
static std::string logPath = "data/log/";
#include "qt/utility/utilityQt.h"
#include "utility/UserPaths.h"
void setup(int argc, char *argv[])
{
@@ -47,6 +47,22 @@ void setup(int argc, char *argv[])
// printf("after change, libraryPaths=(%s)\n", QCoreApplication::libraryPaths().join(",").toUtf8().data());
}
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Makes the mac bundle copy the user files to the Application Support folder
QString dataPath = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
QDir dataDir(dataPath);
if (!dataDir.exists())
{
dataDir.mkpath(dataPath);
}
utility::copyNewFilesFromDirectory(QString::fromStdString(UserPaths::getUserDataPath()), dataPath);
UserPaths::setUserDataPath(dataPath.toStdString() + "/");
// ----------------------------------------------------------------------------
}
#endif // INCLUDES_MAC_H