refactor: some Application & style things (#5561)

This commit is contained in:
pajlada
2024-08-25 15:33:07 +02:00
committed by GitHub
parent ac88730563
commit 627c735524
41 changed files with 733 additions and 678 deletions
+8
View File
@@ -20,6 +20,7 @@ class BaseApplication : public EmptyApplication
public:
BaseApplication()
: settings(this->args, this->settingsDir.path())
, updates(this->paths_, this->settings)
, theme(this->paths_)
, fonts(this->settings)
{
@@ -28,11 +29,17 @@ public:
explicit BaseApplication(const QString &settingsData)
: EmptyApplication(settingsData)
, settings(this->args, this->settingsDir.path())
, updates(this->paths_, this->settings)
, theme(this->paths_)
, fonts(this->settings)
{
}
Updates &getUpdates() override
{
return this->updates;
}
IStreamerMode *getStreamerMode() override
{
return &this->streamerMode;
@@ -60,6 +67,7 @@ public:
Args args;
Settings settings;
Updates updates;
DisabledStreamerMode streamerMode;
Theme theme;
Fonts fonts;
+1 -11
View File
@@ -12,13 +12,9 @@ namespace chatterino::mock {
class EmptyApplication : public IApplication
{
public:
EmptyApplication()
: updates_(this->paths_)
{
}
EmptyApplication() = default;
explicit EmptyApplication(const QString &settingsData)
: EmptyApplication()
{
QFile settingsFile(this->settingsDir.filePath("settings.json"));
settingsFile.open(QIODevice::WriteOnly | QIODevice::Text);
@@ -212,11 +208,6 @@ public:
}
#endif
Updates &getUpdates() override
{
return this->updates_;
}
BttvEmotes *getBttvEmotes() override
{
assert(false && "EmptyApplication::getBttvEmotes was called without "
@@ -269,7 +260,6 @@ public:
QTemporaryDir settingsDir;
Paths paths_;
Args args_;
Updates updates_;
};
} // namespace chatterino::mock