Changeset View
Changeset View
Standalone View
Standalone View
ksplash/ksplashqml/splashapp.cpp
Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Line(s) | 55 | { | |||
---|---|---|---|---|---|
67 | m_theme = parser.positionalArguments().value(0); | 67 | m_theme = parser.positionalArguments().value(0); | ||
68 | 68 | | |||
69 | QDBusConnection dbus = QDBusConnection::sessionBus(); | 69 | QDBusConnection dbus = QDBusConnection::sessionBus(); | ||
70 | dbus.registerObject(QStringLiteral("/KSplash"), this, QDBusConnection::ExportScriptableSlots); | 70 | dbus.registerObject(QStringLiteral("/KSplash"), this, QDBusConnection::ExportScriptableSlots); | ||
71 | dbus.registerService(QStringLiteral("org.kde.KSplash")); | 71 | dbus.registerService(QStringLiteral("org.kde.KSplash")); | ||
72 | 72 | | |||
73 | setupWaylandIntegration(); | 73 | setupWaylandIntegration(); | ||
74 | 74 | | |||
75 | foreach(QScreen* screen, screens()) | 75 | const auto theScreens = screens(); | ||
76 | for (QScreen* screen : theScreens) | ||||
76 | adoptScreen(screen); | 77 | adoptScreen(screen); | ||
77 | 78 | | |||
78 | setStage(QStringLiteral("initial")); | 79 | setStage(QStringLiteral("initial")); | ||
79 | 80 | | |||
80 | if (KWindowSystem::isPlatformWayland()) { | 81 | if (KWindowSystem::isPlatformWayland()) { | ||
81 | setStage(QStringLiteral("wm")); | 82 | setStage(QStringLiteral("wm")); | ||
82 | } | 83 | } | ||
83 | 84 | | |||
Show All 40 Lines | |||||
124 | } | 125 | } | ||
125 | 126 | | |||
126 | void SplashApp::setStage(int stage) | 127 | void SplashApp::setStage(int stage) | ||
127 | { | 128 | { | ||
128 | m_stage = stage; | 129 | m_stage = stage; | ||
129 | if (m_stage == 7) { | 130 | if (m_stage == 7) { | ||
130 | QGuiApplication::exit(EXIT_SUCCESS); | 131 | QGuiApplication::exit(EXIT_SUCCESS); | ||
131 | } | 132 | } | ||
132 | foreach (SplashWindow *w, m_windows) { | 133 | for (SplashWindow *w : qAsConst(m_windows)) { | ||
133 | w->setStage(stage); | 134 | w->setStage(stage); | ||
134 | } | 135 | } | ||
135 | } | 136 | } | ||
136 | 137 | | |||
137 | void SplashApp::adoptScreen(QScreen* screen) | 138 | void SplashApp::adoptScreen(QScreen* screen) | ||
138 | { | 139 | { | ||
139 | SplashWindow *w = new SplashWindow(m_testing, m_window, m_theme); | 140 | SplashWindow *w = new SplashWindow(m_testing, m_window, m_theme); | ||
140 | w->setGeometry(screen->geometry()); | 141 | w->setGeometry(screen->geometry()); | ||
Show All 31 Lines |