mirror-chatterino2/src/singletons/Paths.hpp

54 lines
1.2 KiB
C++
Raw Normal View History

#pragma once
#include <QString>
2018-06-21 13:02:34 +02:00
#include <boost/optional.hpp>
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-08-06 21:17:03 +02:00
// Root directory for the configuration files. %APPDATA%/chatterino or
// ExecutablePath for portable mode
2018-06-21 13:02:34 +02:00
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;
// 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;
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