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:
+46
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user