Add confirmation after download on Symbian.
[dorian] / trace.h
1 #ifndef TRACE_H
2 #define TRACE_H
3
4 #include <QtGlobal>
5 #include <QtDebug>
6 #include <QString>
7 #include <QTime>
8 #include <QEvent>
9
10 #ifdef Q_OS_SYMBIAN
11 #   ifdef __PRETTY_FUNCTION__
12 #       define TRACE Trace _(__PRETTY_FUNCTION__)
13 #   else
14 #       define TRACE Trace _(__FUNCTION__)
15 #   endif
16 #else
17 #   define TRACE Trace _(Q_FUNC_INFO)
18 #endif
19
20 /** Trace helper. */
21 class Trace
22 {
23 public:
24     Trace(const QString &s);
25     ~Trace();
26     static QString event(QEvent::Type t);
27     static void messageHandler(QtMsgType type, const char *msg);
28     static QtMsgType level;
29
30 protected:
31     static QString prefix();
32     QString name;
33     static int indent;
34     typedef struct {int type; const char *name;} EventName;
35     static EventName eventTab[];
36 };
37
38 #endif // TRACE_H