X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=inline;f=src%2Fqtui%2Fqtuiapplication.cpp;h=33829e818ace3d18305831dd3de31b97ded34aa8;hb=d6776e3276f91e2161836f82dfa8caebe596286d;hp=90e2739d5dd35a2e62ea1ca2721801f03630c516;hpb=034708a59ca1ee3195263a90941a2b145c520fef;p=quassel.git diff --git a/src/qtui/qtuiapplication.cpp b/src/qtui/qtuiapplication.cpp index 90e2739d..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,34 +27,21 @@ #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) - : QApplication(argc, argv), Quassel() +#ifdef HAVE_KDE + : KApplication(), +#else + : QApplication(argc, argv), +#endif + Quassel(), + _aboutToQuit(false) { - setRunMode(Quassel::ClientOnly); +#ifdef HAVE_KDE + Q_UNUSED(argc) + Q_UNUSED(argv) +#endif - // put client-only arguments here - CliParser *parser = Quassel::cliParser(); - parser->addSwitch("debugbufferswitches",0,"Enables debugging for bufferswitches"); - parser->addSwitch("debugmodel",0,"Enables debugging for models"); + setRunMode(Quassel::ClientOnly); qInstallMsgHandler(Client::logMessage); } @@ -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();