Fix kinetic scrolling on Symbian. Fix timer handling.
[dorian] / trace.h
diff --git a/trace.h b/trace.h
index d3ceb40..843be64 100644 (file)
--- a/trace.h
+++ b/trace.h
@@ -2,27 +2,26 @@
 #define TRACE_H
 
 #include <QtDebug>
+#include <QString>
+#include <QTime>
+#include <QEvent>
 
+/** Trace helper. */
 class Trace
 {
 public:
-    Trace(const QString &s): name(s) {
-        qDebug() << QString(" ").repeated(indent) + ">" + name;
-        indent++;
-    }
-    ~Trace() {
-        if (--indent < 0) {
-            indent = 0;
-        }
-        qDebug() << QString(" ").repeated(indent) + "<" + name;
-    }
-    void trace(const QString &s) const {
-        qDebug() << QString(" ").repeated(indent)  + name + ": " + s;
-    }
+    Trace(const QString &s);
+    ~Trace();
+    static QString event(QEvent::Type t);
+    static void messageHandler(QtMsgType type, const char *msg);
+    static QtMsgType level;
 
 protected:
+    static QString prefix();
     QString name;
     static int indent;
+    typedef struct {int type; const char *name;} EventName;
+    static EventName eventTab[];
 };
 
 #endif // TRACE_H