The Quassel Core now remembers on exit which networks where connected and which channels
[quassel.git] / src / common / main.cpp
index 00d7c86..cb935e7 100644 (file)
@@ -98,8 +98,18 @@ int main(int argc, char **argv) {
   gui->init();
 #endif
 
+#ifndef BUILD_QTUI
+  if(!QCoreApplication::arguments().contains("--norestore")) {
+    Core::restoreState();
+  }
+#endif
+
   int exitCode = app.exec();
 
+#ifndef BUILD_QTUI
+  Core::saveState();
+#endif
+
 #ifndef BUILD_CORE
   // the mainWin has to be deleted before the Core
   // if not Quassel will crash on exit under certain conditions since the gui