refactor: some more Application refactors (#5551)
This commit is contained in:
@@ -21,26 +21,14 @@ using namespace chatterino;
|
||||
|
||||
namespace {
|
||||
|
||||
class MockApplication : mock::BaseApplication
|
||||
class MockApplication : public mock::BaseApplication
|
||||
{
|
||||
public:
|
||||
MockApplication()
|
||||
: theme(this->paths_)
|
||||
, fonts(this->settings)
|
||||
, windowManager(this->paths_)
|
||||
: windowManager(this->paths_, this->settings, this->theme, this->fonts)
|
||||
{
|
||||
}
|
||||
|
||||
Theme *getThemes() override
|
||||
{
|
||||
return &this->theme;
|
||||
}
|
||||
|
||||
Fonts *getFonts() override
|
||||
{
|
||||
return &this->fonts;
|
||||
}
|
||||
|
||||
WindowManager *getWindows() override
|
||||
{
|
||||
return &this->windowManager;
|
||||
@@ -52,8 +40,6 @@ public:
|
||||
}
|
||||
|
||||
AccountController accounts;
|
||||
Theme theme;
|
||||
Fonts fonts;
|
||||
WindowManager windowManager;
|
||||
};
|
||||
|
||||
|
||||
+2
-15
@@ -17,32 +17,19 @@ using namespace chatterino;
|
||||
|
||||
namespace {
|
||||
|
||||
class MockApplication : mock::BaseApplication
|
||||
class MockApplication : public mock::BaseApplication
|
||||
{
|
||||
public:
|
||||
MockApplication()
|
||||
: theme(this->paths_)
|
||||
, fonts(this->settings)
|
||||
, windowManager(this->paths_)
|
||||
: windowManager(this->paths_, this->settings, this->theme, this->fonts)
|
||||
{
|
||||
}
|
||||
Theme *getThemes() override
|
||||
{
|
||||
return &this->theme;
|
||||
}
|
||||
|
||||
Fonts *getFonts() override
|
||||
{
|
||||
return &this->fonts;
|
||||
}
|
||||
|
||||
WindowManager *getWindows() override
|
||||
{
|
||||
return &this->windowManager;
|
||||
}
|
||||
|
||||
Theme theme;
|
||||
Fonts fonts;
|
||||
WindowManager windowManager;
|
||||
};
|
||||
|
||||
|
||||
@@ -28,16 +28,16 @@ TEST(SeventvEventAPI, AllEvents)
|
||||
std::optional<EmoteRemoveDispatch> removeDispatch;
|
||||
std::optional<UserConnectionUpdateDispatch> userDispatch;
|
||||
|
||||
eventAPI.signals_.emoteAdded.connect([&](const auto &d) {
|
||||
std::ignore = eventAPI.signals_.emoteAdded.connect([&](const auto &d) {
|
||||
addDispatch = d;
|
||||
});
|
||||
eventAPI.signals_.emoteUpdated.connect([&](const auto &d) {
|
||||
std::ignore = eventAPI.signals_.emoteUpdated.connect([&](const auto &d) {
|
||||
updateDispatch = d;
|
||||
});
|
||||
eventAPI.signals_.emoteRemoved.connect([&](const auto &d) {
|
||||
std::ignore = eventAPI.signals_.emoteRemoved.connect([&](const auto &d) {
|
||||
removeDispatch = d;
|
||||
});
|
||||
eventAPI.signals_.userUpdated.connect([&](const auto &d) {
|
||||
std::ignore = eventAPI.signals_.userUpdated.connect([&](const auto &d) {
|
||||
userDispatch = d;
|
||||
});
|
||||
|
||||
|
||||
@@ -28,27 +28,16 @@ class MockApplication : public mock::BaseApplication
|
||||
{
|
||||
public:
|
||||
MockApplication()
|
||||
: theme(this->paths_)
|
||||
, fonts(this->settings)
|
||||
, windowManager(this->paths_)
|
||||
: windowManager(this->paths_, this->settings, this->theme, this->fonts)
|
||||
, commands(this->paths_)
|
||||
{
|
||||
}
|
||||
Theme *getThemes() override
|
||||
{
|
||||
return &this->theme;
|
||||
}
|
||||
|
||||
HotkeyController *getHotkeys() override
|
||||
{
|
||||
return &this->hotkeys;
|
||||
}
|
||||
|
||||
Fonts *getFonts() override
|
||||
{
|
||||
return &this->fonts;
|
||||
}
|
||||
|
||||
WindowManager *getWindows() override
|
||||
{
|
||||
return &this->windowManager;
|
||||
@@ -69,9 +58,7 @@ public:
|
||||
return &this->emotes;
|
||||
}
|
||||
|
||||
Theme theme;
|
||||
HotkeyController hotkeys;
|
||||
Fonts fonts;
|
||||
WindowManager windowManager;
|
||||
AccountController accounts;
|
||||
CommandController commands;
|
||||
|
||||
Reference in New Issue
Block a user