| 20 #include "crashCatcher.h" |
20 #include "crashCatcher.h" |
| 21 #include "ldpaths.h" |
21 #include "ldpaths.h" |
| 22 #include "documentmanager.h" |
22 #include "documentmanager.h" |
| 23 #include "mainwindow.h" |
23 #include "mainwindow.h" |
| 24 |
24 |
| |
25 Configuration& configuration() |
| |
26 { |
| |
27 static Configuration configuration; |
| |
28 return configuration; |
| |
29 } |
| |
30 |
| 25 int main (int argc, char* argv[]) |
31 int main (int argc, char* argv[]) |
| 26 { |
32 { |
| 27 QApplication app (argc, argv); |
33 QApplication app (argc, argv); |
| 28 app.setOrganizationName (APPNAME); |
34 app.setOrganizationName (APPNAME); |
| 29 app.setApplicationName (APPNAME); |
35 app.setApplicationName (APPNAME); |
| 30 |
36 |
| 31 static Configuration configObject; |
37 LDPaths* paths = new LDPaths(&configuration()); |
| 32 LDPaths* paths = new LDPaths(&configObject); |
|
| 33 paths->checkPaths(); |
38 paths->checkPaths(); |
| 34 paths->deleteLater(); |
39 paths->deleteLater(); |
| 35 |
40 |
| 36 initializeCrashHandler(); |
41 initializeCrashHandler(); |
| 37 LDColor::initColors(); |
42 LDColor::initColors(); |
| 38 MainWindow* win = new MainWindow(configObject); |
43 MainWindow mainWindow; |
| 39 win->show(); |
44 mainWindow.show(); |
| 40 |
45 |
| 41 // Process the command line |
46 // Process the command line |
| 42 for (int arg = 1; arg < argc; ++arg) |
47 for (int arg = 1; arg < argc; ++arg) |
| 43 win->documents()->openMainModel (QString::fromLocal8Bit (argv[arg])); |
48 mainWindow.documents()->openMainModel(QString::fromLocal8Bit (argv[arg])); |
| 44 |
49 |
| 45 return app.exec(); |
50 return app.exec(); |
| 46 } |
51 } |