Commit 8d7faee0 authored by David Edmundson's avatar David Edmundson
Browse files

[plasma-shutdown] Avoid timeout when closing ksmserver

closeSession returns only when the task is complete, a sound API, but we
need to remember to increase the timeout.

If a user has unsaved changes in kate, they could handle that prompt
after an indefinite period of time. We would still want to shutdown

Currently plasma-shutdown would abort if it thought ksmserver timed out.

Not seen in real life, just spotted in code review.
parent 7c479d7c
......@@ -43,6 +43,8 @@ void Shutdown::startLogout(KWorkSpace::ShutdownType shutdownType)
m_shutdownType = shutdownType;
OrgKdeKSMServerInterfaceInterface ksmserverIface(QStringLiteral("org.kde.ksmserver"), QStringLiteral("/KSMServer"), QDBusConnection::sessionBus());
ksmserverIface.setTimeout(INT32_MAX); // KSMServer closeSession can take a long time to reply, as apps may have prompts. Value corresponds to DBUS_TIMEOUT_INFINITE
auto closeSessionReply = ksmserverIface.closeSession();
auto watcher = new QDBusPendingCallWatcher(closeSessionReply, this);
connect(watcher, &QDBusPendingCallWatcher::finished, this, [closeSessionReply, watcher, this]() {
Supports Markdown
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