diff --git a/src/singletons/pathmanager.cpp b/src/singletons/pathmanager.cpp index a6356b208..9d6e73155 100644 --- a/src/singletons/pathmanager.cpp +++ b/src/singletons/pathmanager.cpp @@ -1,5 +1,6 @@ -#include "pathmanager.hpp" +#include "singletons/pathmanager.hpp" +#include #include #include @@ -23,10 +24,14 @@ bool PathManager::init(int argc, char **argv) } } + if (QFileInfo::exists(QCoreApplication::applicationDirPath() + "/portable")) { + portable = true; + } + // Root path = %APPDATA%/Chatterino or the folder that the executable resides in QString rootPath; if (portable) { - rootPath.append(QDir::currentPath()); + rootPath.append(QCoreApplication::applicationDirPath()); } else { // Get settings path rootPath.append(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)); diff --git a/src/singletons/pathmanager.hpp b/src/singletons/pathmanager.hpp index f2d3e83ef..c4e6875d8 100644 --- a/src/singletons/pathmanager.hpp +++ b/src/singletons/pathmanager.hpp @@ -14,8 +14,13 @@ public: bool init(int argc, char **argv); + // %APPDATA%/chatterino or ExecutablePath for portable mode QString settingsFolderPath; + + // %APPDATA%/chatterino/Custom or ExecutablePath/Custom for portable mode QString customFolderPath; + + // %APPDATA%/chatterino/Cache or ExecutablePath/Cache for portable mode QString cacheFolderPath; // Logs