move around files

This commit is contained in:
Rasmus Karlsson
2017-06-06 14:48:14 +02:00
parent 71f64cd6ff
commit ccf8e3bd83
148 changed files with 115 additions and 107 deletions
+28
View File
@@ -0,0 +1,28 @@
#include "appdatapath.h"
#include <QDebug>
#include <QDir>
#include <QStandardPaths>
QString Path::appdataPath;
std::mutex Path::appdataPathMutex;
const QString &Path::getAppdataPath()
{
std::lock_guard<std::mutex> lock(appdataPathMutex);
if (appdataPath.isEmpty()) {
#ifdef PORTABLE
QString path = QCoreApplication::applicationDirPath();
#else
QString path =
QStandardPaths::writableLocation(QStandardPaths::AppDataLocation) + "/Chatterino2/";
#endif
QDir(QDir::root()).mkdir(path);
appdataPath = path;
}
return appdataPath;
}