Increase default trace level. Set level from Developer dialog box.
[dorian] / main.cpp
1 #ifdef Q_OS_UNIX
2 #include <unistd.h>
3 #endif
4
5 #include <QtGui/QApplication>
6
7 #include "mainwindow.h"
8 #include "trace.h"
9 #include "settings.h"
10
11 int main(int argc, char *argv[])
12 {
13     QApplication a(argc, argv);
14     a.setApplicationName("Dorian");
15     a.setApplicationVersion("0.0.1");
16     a.setOrganizationDomain("pipacs.com");
17     a.setOrganizationName("Pipacs");
18
19     Trace::level = (QtMsgType)Settings::instance()->
20         value("tracelevel", (int)QtWarningMsg).toInt();
21     qInstallMsgHandler(Trace::messageHandler);
22
23     MainWindow w;
24 #ifdef Q_WS_S60
25     w.showMaximized();
26 #else
27     w.show();
28 #endif
29
30     int ret = a.exec();
31     if (ret == 1000) {
32 #ifdef Q_OS_UNIX
33         extern char **environ;
34         execve(argv[0], argv, environ);
35 #endif
36     }
37     return ret;
38 }