Skip to content

Commit

Permalink
refactor: some Application & style things (Chatterino#5561)
Browse files Browse the repository at this point in the history
  • Loading branch information
pajlada authored Aug 25, 2024
1 parent ac88730 commit 627c735
Show file tree
Hide file tree
Showing 41 changed files with 724 additions and 669 deletions.
3 changes: 3 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ CheckOptions:

- key: misc-const-correctness.AnalyzeValues
value: false

- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: true
8 changes: 8 additions & 0 deletions mocks/include/mocks/BaseApplication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -28,11 +29,17 @@ class BaseApplication : public EmptyApplication
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;
Expand Down Expand Up @@ -60,6 +67,7 @@ class BaseApplication : public EmptyApplication

Args args;
Settings settings;
Updates updates;
DisabledStreamerMode streamerMode;
Theme theme;
Fonts fonts;
Expand Down
12 changes: 1 addition & 11 deletions mocks/include/mocks/EmptyApplication.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -212,11 +208,6 @@ class EmptyApplication : public IApplication
}
#endif

Updates &getUpdates() override
{
return this->updates_;
}

BttvEmotes *getBttvEmotes() override
{
assert(false && "EmptyApplication::getBttvEmotes was called without "
Expand Down Expand Up @@ -269,7 +260,6 @@ class EmptyApplication : public IApplication
QTemporaryDir settingsDir;
Paths paths_;
Args args_;
Updates updates_;
};

} // namespace chatterino::mock
Loading

0 comments on commit 627c735

Please sign in to comment.