File 0001-Close-the-plasmoid-after-updates-got-installed.patch of Package plasma5-pk-updates
From f7aef3bb8d7e0839470318cf9326d90ab95e0cf5 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Fri, 9 Feb 2018 14:43:10 +0100
Subject: [PATCH] Close the plasmoid after updates got installed
Summary:
The plasmoid searches for the next batch of updates which might be misleading.
Related: https://bugs.kde.org/show_bug.cgi?id=390143
Test Plan: Installed updates, plasmoid closed.
Reviewers: lukas, jgrulich
Subscribers: plasma-devel
Differential Revision: https://phabricator.kde.org/D10404
---
src/declarative/pkupdates.cpp | 1 +
src/declarative/pkupdates.h | 5 +++++
src/plasma/contents/ui/Full.qml | 1 +
3 files changed, 7 insertions(+)
diff --git a/src/declarative/pkupdates.cpp b/src/declarative/pkupdates.cpp
index 50265c9..71b9847 100644
--- a/src/declarative/pkupdates.cpp
+++ b/src/declarative/pkupdates.cpp
@@ -395,6 +395,7 @@ void PkUpdates::onFinished(PackageKit::Transaction::Exit status, uint runtime)
KNotification::event(KNotification::Notification, i18n("Updates Installed"),
i18np("Successfully updated %1 package", "Successfully updated %1 packages", packages.count()),
KIconLoader::global()->loadIcon("system-software-update", KIconLoader::Desktop), 0, KNotification::Persistent);
+ emit updatesInstalled();
} else {
qCDebug(PLASMA_PK_UPDATES) << "Update packages transaction didn't finish successfully";
// just try to refresh cache in case of error, the user might have installed the updates manually meanwhile
diff --git a/src/declarative/pkupdates.h b/src/declarative/pkupdates.h
index 6bb1b83..1f17da5 100644
--- a/src/declarative/pkupdates.h
+++ b/src/declarative/pkupdates.h
@@ -144,6 +144,11 @@ signals:
*/
void done();
+ /**
+ * Emitted after updates were installed successfully
+ */
+ void updatesInstalled();
+
/**
* Emitted with update details
* @see getUpdateDetails()
diff --git a/src/plasma/contents/ui/Full.qml b/src/plasma/contents/ui/Full.qml
index 15c955f..eca7ec0 100644
--- a/src/plasma/contents/ui/Full.qml
+++ b/src/plasma/contents/ui/Full.qml
@@ -45,6 +45,7 @@ Item {
target: PkUpdates
onUpdatesChanged: populateModel()
onUpdateDetail: updateDetails(packageID, updateText, urls)
+ onUpdatesInstalled: plasmoid.expanded = false
}
Component.onCompleted: populateModel()
--
2.16.1