Perform initial refactoring work

Things that were once singletons are no longer singletons, but are
instead stored in the "Application" singleton

Some singletons still remain, and some renaming/renamespacing is left
This commit is contained in:
Rasmus Karlsson
2018-04-27 22:11:19 +02:00
parent 32b6417a55
commit ae26b835b6
78 changed files with 850 additions and 773 deletions
+46 -3
View File
@@ -7,16 +7,59 @@
namespace chatterino {
namespace singletons {
class ThemeManager;
class WindowManager;
class LoggingManager;
class PathManager;
class CommandManager;
class AccountManager;
class EmoteManager;
class PubSubManager;
class NativeMessagingManager;
class SettingManager;
} // namespace singletons
class Application
{
Application(int _argc, char **_argv);
public:
Application();
~Application();
static void instantiate(int argc, char **argv);
~Application() = delete;
void construct();
void initialize();
void load();
int run(QApplication &qtApp);
private:
singletons::PathManager *paths = nullptr;
singletons::ThemeManager *themes = nullptr;
singletons::WindowManager *windows = nullptr;
singletons::LoggingManager *logging = nullptr;
singletons::CommandManager *commands = nullptr;
singletons::AccountManager *accounts = nullptr;
singletons::EmoteManager *emotes = nullptr;
singletons::PubSubManager *pubsub = nullptr;
singletons::NativeMessagingManager *nativeMessaging = nullptr;
singletons::SettingManager *settings = nullptr;
void save();
// Special application mode that only initializes the native messaging host
static void runNativeMessagingHost();
private:
int argc;
char **argv;
};
Application *getApp();
bool appInitialized();
} // namespace chatterino