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:
Rasmus Karlsson
2017-06-13 21:13:58 +02:00
parent 55b04ee7eb
commit 59d383c161
37 changed files with 630 additions and 523 deletions
+42
View File
@@ -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