refactor: Un-singletonize Paths & Updates (#5092)
This commit is contained in:
@@ -15,12 +15,8 @@ using namespace std::literals;
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
Paths *Paths::instance = nullptr;
|
||||
|
||||
Paths::Paths()
|
||||
{
|
||||
this->instance = this;
|
||||
|
||||
this->initAppFilePathHash();
|
||||
|
||||
this->initCheckPortable();
|
||||
@@ -33,12 +29,12 @@ bool Paths::createFolder(const QString &folderPath)
|
||||
return QDir().mkpath(folderPath);
|
||||
}
|
||||
|
||||
bool Paths::isPortable()
|
||||
bool Paths::isPortable() const
|
||||
{
|
||||
return Modes::instance().isPortable;
|
||||
}
|
||||
|
||||
QString Paths::cacheDirectory()
|
||||
QString Paths::cacheDirectory() const
|
||||
{
|
||||
static const auto pathSetting = [] {
|
||||
QStringSetting cachePathSetting("/cache/path");
|
||||
@@ -146,9 +142,4 @@ void Paths::initSubDirectories()
|
||||
this->crashdumpDirectory = makePath("Crashes");
|
||||
}
|
||||
|
||||
Paths *getPaths()
|
||||
{
|
||||
return Paths::instance;
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
|
||||
Reference in New Issue
Block a user