[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
afterwards.

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

Not seen in real life, just spotted in code review.
wilder-5.22
David Edmundson 5 years ago
parent 7c479d7ca9
commit 8d7faee0f6
  1. 2
      startkde/plasma-shutdown/shutdown.cpp

@ -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]() {

Loading…
Cancel
Save