refactor: Un-singletonize Paths & Updates (#5092)

This commit is contained in:
pajlada
2024-01-16 21:56:43 +01:00
committed by GitHub
parent 7f935665f9
commit 718696db53
60 changed files with 237 additions and 165 deletions
+2 -11
View File
@@ -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