Huge refactor
- Remove some underscore-prefixes
- Start using this-> more
- Remove a few of the singletons (We pass references to managers to
things that need it now. Might not be much better, but for now
it works. It also shows what places might be slightly wrong
designed)
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#include "application.hpp"
|
||||
#include "colorscheme.hpp"
|
||||
#include "settingsmanager.hpp"
|
||||
|
||||
namespace chatterino {
|
||||
|
||||
Application::Application()
|
||||
: windowManager(this->channelManager)
|
||||
, emoteManager(this->windowManager, this->resources)
|
||||
, resources(this->emoteManager, this->windowManager)
|
||||
, channelManager(this->windowManager, this->emoteManager, this->ircManager)
|
||||
, ircManager(this->channelManager, this->resources, this->emoteManager, this->windowManager)
|
||||
{
|
||||
// TODO(pajlada): Get rid of all singletons
|
||||
ColorScheme::getInstance().init(this->windowManager);
|
||||
|
||||
// Initialize everything we need
|
||||
this->emoteManager.loadGlobalEmotes();
|
||||
|
||||
// XXX
|
||||
SettingsManager::getInstance().updateWordTypeMask();
|
||||
|
||||
this->windowManager.load();
|
||||
}
|
||||
|
||||
Application::~Application()
|
||||
{
|
||||
this->windowManager.save();
|
||||
}
|
||||
|
||||
int Application::run(QApplication &qtApp)
|
||||
{
|
||||
// Start connecting to the IRC Servers (Twitch only for now)
|
||||
this->ircManager.connect();
|
||||
|
||||
// Show main window
|
||||
this->windowManager.getMainWindow().show();
|
||||
|
||||
return qtApp.exec();
|
||||
}
|
||||
|
||||
} // namespace chatterino
|
||||
Reference in New Issue
Block a user