Yearly copyright bump :)
[quassel.git] / src / qtui / qtuiapplication.cpp
index 0049bff..b6f9ca3 100644 (file)
@@ -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  *
 #include "qtui.h"
 #include "sessionsettings.h"
 
-QtUiApplication::QtUiApplication(int &argc, char **argv) : QApplication(argc, argv), Quassel() {
-  Q_INIT_RESOURCE(pics);
-# ifdef QUASSEL_ICONS_BUILTIN
-  Q_INIT_RESOURCE(hicolor);
-# endif
-# ifdef OXYGEN_ICONS_BUILTIN
-  Q_INIT_RESOURCE(oxygen);
-# endif
+
+// 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() {
@@ -53,7 +68,6 @@ bool QtUiApplication::init() {
     // QTimer::singleShot(0, gui, SLOT(init()));
     gui->init();
     resumeSessionIfPossible();
-
     return true;
   }
   return false;
@@ -88,3 +102,5 @@ void QtUiApplication::resumeSessionIfPossible() {
     s.cleanup();
   }
 }
+
+