src/hbservers/themechanger/themechangermain.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
--- a/src/hbservers/themechanger/themechangermain.cpp	Mon Apr 19 14:02:13 2010 +0300
+++ b/src/hbservers/themechanger/themechangermain.cpp	Mon May 03 12:48:33 2010 +0300
@@ -27,15 +27,42 @@
 #include <hbmainwindow.h>
 #include "themechangerdefs.h"
 #include "themeselectionlist.h"
-
+#include <QTextStream>
 #ifdef Q_OS_SYMBIAN
 #include "themeclientsymbian.h"
 #else
 #include "themeclientqt.h"
 #endif
 
+#ifdef THEME_CHANGER_TIMER_LOG
+void debugOutput(QtMsgType type, const char *msg)
+ {
+    QFile file("c:/data/logs/themechanger.txt");
+
+    if (!file.open(QIODevice::Append))
+        return;
+    QTextStream out(&file);
+
+    switch (type)
+    {
+    case QtDebugMsg:
+        out << msg << QChar::LineSeparator;
+        break;
+    case QtWarningMsg:
+        break;
+    case QtCriticalMsg:
+        break;
+    case QtFatalMsg:
+        break;
+    }
+ }
+#endif //THEME_CHANGER_TIMER_LOG
+
 int main(int argc, char *argv[])
 {
+#ifdef THEME_CHANGER_TIMER_LOG
+    qInstallMsgHandler(debugOutput);
+#endif
     // Initialization
     HbApplication app(argc, argv);
     app.setApplicationName("ThemeChanger");