This could / should / I just wish it does / who the hell knows / whatever / <insert...
[quassel.git] / src / qtui / qtuiapplication.cpp
index b6f9ca3..33829e8 100644 (file)
 #include "qtui.h"
 #include "sessionsettings.h"
 
-
-// void myMessageOutput(QtMsgType type, const char *msg) {
-//   Client::debugLog() << "Debug:" <<  msg << '\n';
-//   return;
-// //   switch (type) {
-// //   case QtDebugMsg:
-// //     break;
-// //   case QtWarningMsg:
-// //     fprintf(stderr, "Warning: %s\n", msg);
-// //     break;
-// //   case QtCriticalMsg:
-// //     fprintf(stderr, "Critical: %s\n", msg);
-// //     break;
-// //   case QtFatalMsg:
-// //     fprintf(stderr, "Fatal: %s\n", msg);
-// //     abort();
-// //   }
-// }
-
 QtUiApplication::QtUiApplication(int &argc, char **argv)
 #ifdef HAVE_KDE
-  : KApplication(), Quassel() {
-  Q_UNUSED(argc); Q_UNUSED(argv);
+  : KApplication(),
 #else
-  : QApplication(argc, argv), Quassel() {
+  : QApplication(argc, argv),
+#endif
+    Quassel(),
+    _aboutToQuit(false)
+{
+#ifdef HAVE_KDE
+  Q_UNUSED(argc)
+  Q_UNUSED(argv)
 #endif
 
   setRunMode(Quassel::ClientOnly);
@@ -77,6 +64,10 @@ QtUiApplication::~QtUiApplication() {
   Client::destroy();
 }
 
+void QtUiApplication::commitData(QSessionManager &manager) {
+  _aboutToQuit = true;
+}
+
 void QtUiApplication::saveState(QSessionManager & manager) {
   //qDebug() << QString("saving session state to id %1").arg(manager.sessionId());
   AccountId activeCore = Client::currentCoreAccount();