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
+12 -17
View File
@@ -1,3 +1,4 @@
#include "application.hpp"
#include "channelmanager.hpp"
#include "colorscheme.hpp"
#include "emojis.hpp"
@@ -16,9 +17,6 @@
#include <boost/signals2.hpp>
#include <pajlada/settings/settingmanager.hpp>
using namespace chatterino;
using namespace chatterino::widgets;
namespace {
inline bool initSettings(bool portable)
@@ -68,28 +66,25 @@ int main(int argc, char *argv[])
}
chatterino::logging::init();
SettingsManager::getInstance().load();
Resources::load();
Emojis::loadEmojis();
EmoteManager::getInstance().loadGlobalEmotes();
chatterino::SettingsManager::getInstance().load();
chatterino::Emojis::loadEmojis();
ColorScheme::getInstance().init();
int ret = 0;
WindowManager::getInstance().load();
{
// Initialize application
chatterino::Application app;
MainWindow &w = WindowManager::getInstance().getMainWindow();
w.show();
// Start the application
ret = app.run(a);
IrcManager::getInstance().connect();
// Application will go out of scope here and deinitialize itself
}
int ret = a.exec();
SettingsManager::getInstance().save();
chatterino::SettingsManager::getInstance().save();
// Save settings
pajlada::Settings::SettingManager::save();
WindowManager::getInstance().save();
return ret;
}