#include "appdatapath.h" #include #include #include QString Path::appdataPath; std::mutex Path::appdataPathMutex; const QString &Path::getAppdataPath() { std::lock_guard 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; }