Changeset View
Changeset View
Standalone View
Standalone View
ksplash/ksplashqml/main.cpp
Show All 17 Lines | |||||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | 20 | | |||
21 | #include "splashapp.h" | 21 | #include "splashapp.h" | ||
22 | #include <QQuickWindow> | 22 | #include <QQuickWindow> | ||
23 | 23 | | |||
24 | #include <QTextStream> | 24 | #include <QTextStream> | ||
25 | 25 | | |||
26 | #include <kworkspace.h> | ||||
27 | | ||||
26 | #include <iostream> | 28 | #include <iostream> | ||
27 | #include <unistd.h> | 29 | #include <unistd.h> | ||
28 | 30 | | |||
29 | void logMessageHandler(QtMsgType type, const char *msg) | 31 | void logMessageHandler(QtMsgType type, const char *msg) | ||
30 | { | 32 | { | ||
31 | QString txt; | 33 | QString txt; | ||
32 | switch (type) { | 34 | switch (type) { | ||
33 | case QtDebugMsg: | 35 | case QtDebugMsg: | ||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 80 | if (pid != 0) { | |||
83 | 85 | | |||
84 | return 0; | 86 | return 0; | ||
85 | } | 87 | } | ||
86 | } | 88 | } | ||
87 | 89 | | |||
88 | //enable to send log output to /tmp/ksplash | 90 | //enable to send log output to /tmp/ksplash | ||
89 | //which is useful for debugging | 91 | //which is useful for debugging | ||
90 | // qInstallMsgHandler(myMessageHandler); | 92 | // qInstallMsgHandler(myMessageHandler); | ||
93 | KWorkSpace::detectPlatform(argc, argv); | ||||
91 | QQuickWindow::setDefaultAlphaBuffer(true); | 94 | QQuickWindow::setDefaultAlphaBuffer(true); | ||
92 | SplashApp app(argc, argv); | 95 | SplashApp app(argc, argv); | ||
93 | 96 | | |||
94 | if (!test && !nofork) { | 97 | if (!test && !nofork) { | ||
95 | // close stdin,stdout,stderr, otherwise startkde will block | 98 | // close stdin,stdout,stderr, otherwise startkde will block | ||
96 | close(0); | 99 | close(0); | ||
97 | close(1); | 100 | close(1); | ||
98 | close(2); | 101 | close(2); | ||
99 | } | 102 | } | ||
100 | 103 | | |||
101 | return app.exec(); | 104 | return app.exec(); | ||
102 | } | 105 | } | ||
103 | 106 | |