common: Make the Quassel class a proper singleton, clean up
[quassel.git] / src / core / coreapplication.cpp
index 7426f17..1a689a2 100644 (file)
@@ -55,6 +55,11 @@ bool CoreApplicationInternal::init()
     Core::instance(); // create and init the core
     _coreCreated = true;
 
+    Quassel::registerReloadHandler([]() {
+        // Currently, only reloading SSL certificates is supported
+        return Core::reloadCerts();
+    });
+
     if (!Quassel::isOptionSet("norestore"))
         Core::restoreState();
 
@@ -62,27 +67,16 @@ bool CoreApplicationInternal::init()
 }
 
 
-bool CoreApplicationInternal::reloadConfig()
-{
-    if (_coreCreated) {
-        // Currently, only reloading SSL certificates is supported
-        return Core::reloadCerts();
-    } else {
-        return false;
-    }
-}
-
-
 /*****************************************************************************/
 
 CoreApplication::CoreApplication(int &argc, char **argv)
-    : QCoreApplication(argc, argv), Quassel()
+    : QCoreApplication(argc, argv)
 {
 #ifdef Q_OS_MAC
-    disableCrashhandler();
+    Quassel::disableCrashHandler();
 #endif /* Q_OS_MAC */
 
-    setRunMode(Quassel::CoreOnly);
+    Quassel::setRunMode(Quassel::CoreOnly);
     _internal = new CoreApplicationInternal();
 }
 
@@ -105,13 +99,3 @@ bool CoreApplication::init()
     }
     return false;
 }
-
-
-bool CoreApplication::reloadConfig()
-{
-    if (_internal) {
-        return _internal->reloadConfig();
-    } else {
-        return false;
-    }
-}