refactor: some Application & style things (#5561)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user