Changeset View
Changeset View
Standalone View
Standalone View
ksplash/ksplashqml/splashapp.cpp
Show All 19 Lines | |||||
20 | 20 | | |||
21 | #include "splashwindow.h" | 21 | #include "splashwindow.h" | ||
22 | #include "splashapp.h" | 22 | #include "splashapp.h" | ||
23 | 23 | | |||
24 | #include <QPixmap> | 24 | #include <QPixmap> | ||
25 | #include <QCursor> | 25 | #include <QCursor> | ||
26 | #include <qscreen.h> | 26 | #include <qscreen.h> | ||
27 | #include <QDBusConnection> | 27 | #include <QDBusConnection> | ||
28 | #include <QDateTime> | | |||
29 | #include <QDate> | 28 | #include <QDate> | ||
30 | #include <QDebug> | 29 | #include <QDebug> | ||
31 | #include <QCommandLineParser> | 30 | #include <QCommandLineParser> | ||
32 | 31 | | |||
33 | #include <KWindowSystem> | 32 | #include <KWindowSystem> | ||
34 | #include <KWayland/Client/connection_thread.h> | 33 | #include <KWayland/Client/connection_thread.h> | ||
35 | #include <KWayland/Client/registry.h> | 34 | #include <KWayland/Client/registry.h> | ||
36 | #include <KWayland/Client/plasmashell.h> | 35 | #include <KWayland/Client/plasmashell.h> | ||
Show All 9 Lines | |||||
46 | * - ready | 45 | * - ready | ||
47 | * - desktop | 46 | * - desktop | ||
48 | */ | 47 | */ | ||
49 | 48 | | |||
50 | SplashApp::SplashApp(int &argc, char ** argv) | 49 | SplashApp::SplashApp(int &argc, char ** argv) | ||
51 | : QGuiApplication(argc, argv), | 50 | : QGuiApplication(argc, argv), | ||
52 | m_stage(0), | 51 | m_stage(0), | ||
53 | m_testing(false), | 52 | m_testing(false), | ||
54 | m_window(false), | 53 | m_window(false) | ||
55 | m_startTime(QDateTime::currentDateTime()) | | |||
56 | { | 54 | { | ||
57 | QCommandLineParser parser; | 55 | QCommandLineParser parser; | ||
58 | parser.addOption(QCommandLineOption(QStringLiteral("test"), QStringLiteral("Run in test mode"))); | 56 | parser.addOption(QCommandLineOption(QStringLiteral("test"), QStringLiteral("Run in test mode"))); | ||
59 | parser.addOption(QCommandLineOption(QStringLiteral("window"), QStringLiteral("Run in windowed mode"))); | 57 | parser.addOption(QCommandLineOption(QStringLiteral("window"), QStringLiteral("Run in windowed mode"))); | ||
60 | parser.addOption(QCommandLineOption(QStringLiteral("nofork"), QStringLiteral("Don't fork"))); | 58 | parser.addOption(QCommandLineOption(QStringLiteral("nofork"), QStringLiteral("Don't fork"))); | ||
61 | parser.addOption(QCommandLineOption(QStringLiteral("pid"), QStringLiteral("Print the pid of the child process"))); | 59 | parser.addOption(QCommandLineOption(QStringLiteral("pid"), QStringLiteral("Print the pid of the child process"))); | ||
62 | parser.addHelpOption(); | 60 | parser.addHelpOption(); | ||
63 | 61 | | |||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Line(s) | |||||
110 | 108 | | |||
111 | void SplashApp::setStage(const QString &stage) | 109 | void SplashApp::setStage(const QString &stage) | ||
112 | { | 110 | { | ||
113 | //filter out startup events from KDED as they will be removed in a future release | 111 | //filter out startup events from KDED as they will be removed in a future release | ||
114 | if (stage == QLatin1String("kded") || stage == QLatin1String("confupdate")) { | 112 | if (stage == QLatin1String("kded") || stage == QLatin1String("confupdate")) { | ||
115 | return; | 113 | return; | ||
116 | } | 114 | } | ||
117 | 115 | | |||
118 | qDebug() << "Loading stage " << stage << m_startTime.msecsTo(QDateTime::currentDateTime()); | | |||
119 | | ||||
120 | if (m_stages.contains(stage)) { | 116 | if (m_stages.contains(stage)) { | ||
121 | return; | 117 | return; | ||
122 | } | 118 | } | ||
123 | m_stages.append(stage); | 119 | m_stages.append(stage); | ||
124 | setStage(m_stages.count()); | 120 | setStage(m_stages.count()); | ||
125 | } | 121 | } | ||
126 | 122 | | |||
127 | void SplashApp::setStage(int stage) | 123 | void SplashApp::setStage(int stage) | ||
▲ Show 20 Lines • Show All 46 Lines • Show Last 20 Lines |