/***************************************************************************
- * 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 *
#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);
}
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();