Changeset View
Changeset View
Standalone View
Standalone View
startkde/plasma-session/startup.cpp
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | |||||
92 | { | 92 | { | ||
93 | Q_OBJECT | 93 | Q_OBJECT | ||
94 | public: | 94 | public: | ||
95 | StartupPhase0(const AutoStart& autostart, QObject *parent) : Phase(autostart, parent) | 95 | StartupPhase0(const AutoStart& autostart, QObject *parent) : Phase(autostart, parent) | ||
96 | {} | 96 | {} | ||
97 | void start() override { | 97 | void start() override { | ||
98 | qCDebug(PLASMA_SESSION) << "Phase 0"; | 98 | qCDebug(PLASMA_SESSION) << "Phase 0"; | ||
99 | addSubjob(new AutoStartAppsJob(m_autostart, 0)); | 99 | addSubjob(new AutoStartAppsJob(m_autostart, 0)); | ||
100 | addSubjob(new KCMInitJob(1)); | 100 | addSubjob(new KCMInitJob()); | ||
101 | addSubjob(new SleepJob()); | 101 | addSubjob(new SleepJob()); | ||
102 | } | 102 | } | ||
103 | }; | 103 | }; | ||
104 | 104 | | |||
105 | class StartupPhase1: public Phase | 105 | class StartupPhase1: public Phase | ||
106 | { | 106 | { | ||
107 | Q_OBJECT | 107 | Q_OBJECT | ||
108 | public: | 108 | public: | ||
Show All 13 Lines | 120 | public: | |||
122 | {} | 122 | {} | ||
123 | void runUserAutostart(); | 123 | void runUserAutostart(); | ||
124 | bool migrateKDE4Autostart(const QString &folder); | 124 | bool migrateKDE4Autostart(const QString &folder); | ||
125 | 125 | | |||
126 | void start() override { | 126 | void start() override { | ||
127 | qCDebug(PLASMA_SESSION) << "Phase 2"; | 127 | qCDebug(PLASMA_SESSION) << "Phase 2"; | ||
128 | addSubjob(new AutoStartAppsJob(m_autostart, 2)); | 128 | addSubjob(new AutoStartAppsJob(m_autostart, 2)); | ||
129 | addSubjob(new KDEDInitJob()); | 129 | addSubjob(new KDEDInitJob()); | ||
130 | addSubjob(new KCMInitJob(2)); | | |||
131 | runUserAutostart(); | 130 | runUserAutostart(); | ||
132 | } | 131 | } | ||
133 | }; | 132 | }; | ||
134 | 133 | | |||
135 | SleepJob::SleepJob() | 134 | SleepJob::SleepJob() | ||
136 | { | 135 | { | ||
137 | } | 136 | } | ||
138 | 137 | | |||
▲ Show 20 Lines • Show All 111 Lines • ▼ Show 20 Line(s) | 247 | { | |||
250 | upAndRunning(QStringLiteral("ready")); | 249 | upAndRunning(QStringLiteral("ready")); | ||
251 | } | 250 | } | ||
252 | 251 | | |||
253 | void Startup::updateLaunchEnv(const QString &key, const QString &value) | 252 | void Startup::updateLaunchEnv(const QString &key, const QString &value) | ||
254 | { | 253 | { | ||
255 | qputenv(key.toLatin1(), value.toLatin1()); | 254 | qputenv(key.toLatin1(), value.toLatin1()); | ||
256 | } | 255 | } | ||
257 | 256 | | |||
258 | KCMInitJob::KCMInitJob(int phase) | 257 | KCMInitJob::KCMInitJob() | ||
259 | :m_phase(phase) | 258 | : KJob() | ||
260 | { | 259 | { | ||
261 | } | 260 | } | ||
262 | 261 | | |||
263 | void KCMInitJob::start() { | 262 | void KCMInitJob::start() { | ||
264 | org::kde::KCMInit kcminit(QStringLiteral("org.kde.kcminit"), | 263 | org::kde::KCMInit kcminit(QStringLiteral("org.kde.kcminit"), | ||
265 | QStringLiteral("/kcminit"), | 264 | QStringLiteral("/kcminit"), | ||
266 | QDBusConnection::sessionBus()); | 265 | QDBusConnection::sessionBus()); | ||
267 | kcminit.setTimeout(10 * 1000); | 266 | kcminit.setTimeout(10 * 1000); | ||
268 | 267 | | |||
269 | QDBusPendingReply<void> pending; | 268 | QDBusPendingReply<void> pending = kcminit.runPhase1(); | ||
270 | if (m_phase == 1) { | | |||
271 | pending = kcminit.runPhase1(); | | |||
272 | } else { | | |||
273 | pending = kcminit.runPhase2(); | | |||
274 | } | | |||
275 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pending, this); | 269 | QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pending, this); | ||
276 | connect(watcher, &QDBusPendingCallWatcher::finished, this, [this]() {emitResult();}); | 270 | connect(watcher, &QDBusPendingCallWatcher::finished, this, [this]() {emitResult();}); | ||
277 | connect(watcher, &QDBusPendingCallWatcher::finished, watcher, &QObject::deleteLater); | 271 | connect(watcher, &QDBusPendingCallWatcher::finished, watcher, &QObject::deleteLater); | ||
278 | } | 272 | } | ||
279 | 273 | | |||
280 | KDEDInitJob::KDEDInitJob() | 274 | KDEDInitJob::KDEDInitJob() | ||
281 | { | 275 | { | ||
282 | } | 276 | } | ||
▲ Show 20 Lines • Show All 150 Lines • Show Last 20 Lines |