Some more fixes
[quassel.git] / src / qtui / qtuiapplication.cpp
index 7a6f097..108b4bf 100644 (file)
 #include "qtui.h"
 #include "sessionsettings.h"
 
-QtUiApplication::QtUiApplication(int &argc, char **argv) : QApplication(argc, argv), Quassel() {
+
+// 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);
+#else
+  : QApplication(argc, argv), Quassel() {
+#endif
+
   setRunMode(Quassel::ClientOnly);
 
-  // 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");
+  qInstallMsgHandler(Client::logMessage);
 }
 
 bool QtUiApplication::init() {
@@ -79,3 +102,5 @@ void QtUiApplication::resumeSessionIfPossible() {
     s.cleanup();
   }
 }
+
+