X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=src%2Fqtui%2Fqtuiapplication.cpp;h=33829e818ace3d18305831dd3de31b97ded34aa8;hb=d6776e3276f91e2161836f82dfa8caebe596286d;hp=6972dd040d7d2230fadc2c99e62da1ad8a6f8d35;hpb=965183188ee726036685fcba379c2559bd183247;p=quassel.git diff --git a/src/qtui/qtuiapplication.cpp b/src/qtui/qtuiapplication.cpp index 6972dd04..33829e81 100644 --- a/src/qtui/qtuiapplication.cpp +++ b/src/qtui/qtuiapplication.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel IRC Team * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -27,32 +27,20 @@ #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() + : 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); qInstallMsgHandler(Client::logMessage); @@ -76,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();