changed application data path from %appdata%/chatterino to

%appdata%/chatterino2
This commit is contained in:
fourtf
2017-04-13 18:51:46 +02:00
parent 138466035f
commit 11fed12be1
9 changed files with 221 additions and 183 deletions
+30
View File
@@ -0,0 +1,30 @@
#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;
}
qDebug() << "memes: " << appdataPath;
return appdataPath;
}