chore: remove Singleton & replace getIApp with getApp (#5514)

This commit is contained in:
pajlada
2024-07-21 15:09:59 +02:00
committed by GitHub
parent 21186df058
commit 5deec1f02f
145 changed files with 802 additions and 856 deletions
+10 -4
View File
@@ -4,7 +4,7 @@
#include "controllers/accounts/AccountController.hpp"
#include "messages/MessageBuilder.hpp"
#include "messages/MessageElement.hpp"
#include "mocks/EmptyApplication.hpp"
#include "mocks/BaseApplication.hpp"
#include "singletons/Emotes.hpp"
#include "singletons/Fonts.hpp"
#include "singletons/Settings.hpp"
@@ -21,15 +21,16 @@ using namespace chatterino;
namespace {
class MockApplication : mock::EmptyApplication
class MockApplication : mock::BaseApplication
{
public:
MockApplication()
: settings(this->settingsDir.filePath("settings.json"))
: theme(this->paths_)
, fonts(this->settings)
, windowManager(this->paths_)
{
}
Theme *getThemes() override
{
return &this->theme;
@@ -45,7 +46,12 @@ public:
return &this->windowManager;
}
Settings settings;
AccountController *getAccounts() override
{
return &this->accounts;
}
AccountController accounts;
Theme theme;
Fonts fonts;
WindowManager windowManager;