Make --norestore work again
[quassel.git] / src / core / coreapplication.cpp
index 99fcfd8..ca0f527 100644 (file)
@@ -52,8 +52,12 @@ bool CoreApplicationInternal::init() {
   Core::instance();  // create and init the core
   _coreCreated = true;
 
   Core::instance();  // create and init the core
   _coreCreated = true;
 
+#ifdef HAVE_KDE
   // if using KDE, option is called "restore" instead of "norestore"
   // if using KDE, option is called "restore" instead of "norestore"
-  if(Quassel::isOptionSet("restore") || !Quassel::isOptionSet("norestore"))
+  if(Quassel::isOptionSet("restore"))
+#else
+  if(!Quassel::isOptionSet("norestore"))
+#endif
     Core::restoreState();
 
   return true;
     Core::restoreState();
 
   return true;
@@ -63,16 +67,14 @@ bool CoreApplicationInternal::init() {
 
 CoreApplication::CoreApplication(int &argc, char **argv)
 #ifdef HAVE_KDE
 
 CoreApplication::CoreApplication(int &argc, char **argv)
 #ifdef HAVE_KDE
-  : KApplication(false),
+: KApplication(false), Quassel() {
+  Q_UNUSED(argc); Q_UNUSED(argv);
 #else
 #else
-  : QCoreApplication(argc, argv),
+: QCoreApplication(argc, argv), Quassel() {
 #endif
 #endif
-    Quassel()
-{
+
   setRunMode(Quassel::CoreOnly);
   _internal = new CoreApplicationInternal();
   setRunMode(Quassel::CoreOnly);
   _internal = new CoreApplicationInternal();
-
-  qInstallMsgHandler(Logger::logMessage);
 }
 
 CoreApplication::~CoreApplication() {
 }
 
 CoreApplication::~CoreApplication() {
@@ -80,7 +82,9 @@ CoreApplication::~CoreApplication() {
 }
 
 bool CoreApplication::init() {
 }
 
 bool CoreApplication::init() {
-  if(Quassel::init())
-    return _internal->init();
+  if(Quassel::init() && _internal->init()) {
+    qInstallMsgHandler(Logger::logMessage);
+    return true;
+  }
   return false;
 }
   return false;
 }