Commit f1ab8b7c authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Don't block all the ksmserver process when calling kded.loadSecondPhase

Summary:
It's an overly slow call and it gets in the way on a process that needs
to be responsive

Test Plan: Still boots

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D9090
parent 0cc0c32c
......@@ -152,6 +152,7 @@ private Q_SLOTS:
void logoutWithoutConfirmation();
void haltWithoutConfirmation();
void rebootWithoutConfirmation();
void secondKDEDPhaseLoaded();
private:
void handlePendingInteractions();
......
......@@ -409,12 +409,11 @@ void KSMServer::autoStart2()
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 @@ void KSMServer::autoStart2()
} 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());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment