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

Prevent the system from logging out if transactions are pending completion

Summary: BUG: 318415

Reviewers: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D13269
parent a421a5c0
......@@ -37,6 +37,7 @@
#include <QGuiApplication>
#include <QSortFilterProxyModel>
#include <QTimer>
#include <QSessionManager>
// KDE includes
#include <KAboutApplicationDialog>
......@@ -279,6 +280,13 @@ void DiscoverObject::integrateObject(QObject* object)
object->installEventFilter(this);
connect(object, &QObject::destroyed, qGuiApp, &QCoreApplication::quit);
connect(qGuiApp, &QGuiApplication::commitDataRequest, this, [this](QSessionManager &sessionManager) {
if (ResourcesModel::global()->isBusy()) {
Q_EMIT preventedClose();
sessionManager.cancel();
}
});
}
bool DiscoverObject::eventFilter(QObject * object, QEvent * event)
......
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