mirror-chatterino2/src/singletons/Paths.hpp

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.5 KiB
C++
Raw Normal View History

#pragma once
2018-06-21 13:02:34 +02:00
#include <boost/optional.hpp>
#include <QString>
namespace chatterino {
2018-06-28 19:51:07 +02:00
class Paths
{
2018-06-13 13:27:10 +02:00
public:
2018-08-02 14:23:27 +02:00
static Paths *instance;
Paths();
2018-06-13 13:27:10 +02:00
2018-06-21 13:02:34 +02:00
// Root directory for the configuration files. %APPDATA%/chatterino or
// ExecutablePath for portable mode
QString rootAppDataDirectory;
2018-06-21 13:02:34 +02:00
// Directory for settings files. Same as <appDataDirectory>/Settings
QString settingsDirectory;
2018-06-21 13:02:34 +02:00
// Directory for message log files. Same as <appDataDirectory>/Misc
QString messageLogDirectory;
2018-06-21 13:02:34 +02:00
// Directory for miscellaneous files. Same as <appDataDirectory>/Misc
QString miscDirectory;
// Directory for crashdumps. Same as <appDataDirectory>/Crashes
QString crashdumpDirectory;
2018-06-21 13:02:34 +02:00
// Hash of QCoreApplication::applicationFilePath()
QString applicationFilePathHash;
2018-04-20 00:15:57 +02:00
// Profile avatars for Twitch <appDataDirectory>/cache/twitch
2018-08-29 23:39:02 +02:00
QString twitchProfileAvatars;
// Plugin files live here. <appDataDirectory>/Plugins
QString pluginsDirectory;
// Custom themes live here. <appDataDirectory>/Themes
QString themesDirectory;
bool createFolder(const QString &folderPath);
2018-05-28 18:25:19 +02:00
bool isPortable();
QString cacheDirectory();
2018-05-28 18:25:19 +02:00
private:
2018-06-21 13:02:34 +02:00
void initAppFilePathHash();
void initCheckPortable();
void initRootDirectory();
2018-06-21 13:02:34 +02:00
void initSubDirectories();
2018-07-06 19:23:47 +02:00
boost::optional<bool> portable_;
// Directory for cache files. Same as <appDataDirectory>/Misc
QString cacheDirectory_;
};
Paths *getPaths();
2018-07-07 11:41:01 +02:00
} // namespace chatterino