diff --git a/ksmserver/server.h b/ksmserver/server.h --- a/ksmserver/server.h +++ b/ksmserver/server.h @@ -152,6 +152,7 @@ void logoutWithoutConfirmation(); void haltWithoutConfirmation(); void rebootWithoutConfirmation(); + void secondKDEDPhaseLoaded(); private: void handlePendingInteractions(); diff --git a/ksmserver/startup.cpp b/ksmserver/startup.cpp --- a/ksmserver/startup.cpp +++ b/ksmserver/startup.cpp @@ -409,12 +409,11 @@ QDBusInterface kded( QStringLiteral( "org.kde.kded5" ), QStringLiteral( "/kded" ), QStringLiteral( "org.kde.kded5" ) ); - kded.call( QStringLiteral( "loadSecondPhase" ) ); - -#ifdef KSMSERVER_STARTUP_DEBUG1 - qCDebug(KSMSERVER)<< "kded" << t.elapsed(); -#endif + auto pending = kded.asyncCall( QStringLiteral( "loadSecondPhase" ) ); + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(pending, this); + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, this, &KSMServer::secondKDEDPhaseLoaded); + QObject::connect(watcher, &QDBusPendingCallWatcher::finished, watcher, &QObject::deleteLater); runUserAutostart(); if (kcminitSignals) { @@ -427,6 +426,15 @@ } else { QTimer::singleShot(0, this, &KSMServer::kcmPhase2Done); } +} + +void KSMServer::secondKDEDPhaseLoaded() +{ + +#ifdef KSMSERVER_STARTUP_DEBUG1 + qCDebug(KSMSERVER)<< "kded" << t.elapsed(); +#endif + if( !defaultSession()) restoreLegacySession(KSharedConfig::openConfig().data());