Hello community, here is the log from the commit of package plasma5-pk-updates for openSUSE:Factory checked in at 2018-01-16 09:35:05 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/plasma5-pk-updates (Old) and /work/SRC/openSUSE:Factory/.plasma5-pk-updates.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "plasma5-pk-updates" Tue Jan 16 09:35:05 2018 rev:9 rq:561644 version:0.3.1 Changes: -------- --- /work/SRC/openSUSE:Factory/plasma5-pk-updates/plasma5-pk-updates.changes 2017-09-18 19:50:27.360950085 +0200 +++ /work/SRC/openSUSE:Factory/.plasma5-pk-updates.new/plasma5-pk-updates.changes 2018-01-16 09:35:08.437992650 +0100 @@ -1,0 +2,8 @@ +Thu Jan 4 14:02:21 UTC 2018 - fab...@ritter-vogt.de + +- Fix refresh logic on startup: + * 0001-Only-save-the-last-update-timestep-on-success.patch + * 0002-Show-that-the-last-check-failed-if-no-updates-availa.patch + * 0003-List-known-updates-on-startup.patch + +------------------------------------------------------------------- New: ---- 0001-Only-save-the-last-update-timestep-on-success.patch 0002-Show-that-the-last-check-failed-if-no-updates-availa.patch 0003-List-known-updates-on-startup.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ plasma5-pk-updates.spec ++++++ --- /var/tmp/diff_new_pack.8mkMD2/_old 2018-01-16 09:35:09.221955971 +0100 +++ /var/tmp/diff_new_pack.8mkMD2/_new 2018-01-16 09:35:09.225955783 +0100 @@ -1,7 +1,7 @@ # # spec file for package plasma5-pk-updates # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -29,6 +29,12 @@ Patch1: 0001-concat-the-string.patch # PATCH-FIX-UPSTREAM Patch2: 0001-Add-DefaultEvent-flag-to-fix-notification-for-relogi.patch +# PATCH-FIX-UPSTREAM +Patch3: 0001-Only-save-the-last-update-timestep-on-success.patch +# PATCH-FIX-UPSTREAM +Patch4: 0002-Show-that-the-last-check-failed-if-no-updates-availa.patch +# PATCH-FIX-UPSTREAM +Patch5: 0003-List-known-updates-on-startup.patch BuildRequires: PackageKit-Qt5-devel BuildRequires: cmake >= 3.0 BuildRequires: extra-cmake-modules >= 1.3.0 @@ -58,8 +64,7 @@ %lang_package %prep %setup -q -n plasma-pk-updates-%{version} -a 1 -%patch1 -p1 -%patch2 -p1 +%autopatch -p1 echo "ki18n_install(po)" >> CMakeLists.txt %build ++++++ 0001-Only-save-the-last-update-timestep-on-success.patch ++++++ >From d9708fb7efead687e38815183596eaf62fbdf3d7 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fab...@ritter-vogt.de> Date: Mon, 25 Dec 2017 17:56:47 +0100 Subject: [PATCH 1/3] Only save the last update timestep on success Summary: If the check for updates failed, it'll trigger a new check on the next timer interval (1h) now. Test Plan: Ran the check with YaST open in the background to cause the check to fail. Now the timestamp does not refresh anymore. Reviewers: lukas, jgrulich Subscribers: plasma-devel Differential Revision: https://phabricator.kde.org/D9503 --- src/declarative/pkupdates.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/declarative/pkupdates.cpp b/src/declarative/pkupdates.cpp index ce46df8..f04c173 100644 --- a/src/declarative/pkupdates.cpp +++ b/src/declarative/pkupdates.cpp @@ -198,11 +198,6 @@ void PkUpdates::checkUpdates(bool force) { qCDebug(PLASMA_PK_UPDATES) << "Checking updates, forced"; - // save the timestamp - KConfigGroup grp(KSharedConfig::openConfig("plasma-pk-updates"), "General"); - grp.writeEntry("Timestamp", QDateTime::currentDateTime().toMSecsSinceEpoch()); - grp.sync(); - // ask the Packagekit daemon to refresh the cache m_cacheTrans = PackageKit::Daemon::refreshCache(force); setActivity(CheckingUpdates); @@ -352,6 +347,12 @@ void PkUpdates::onFinished(PackageKit::Transaction::Exit status, uint runtime) if (trans->role() == PackageKit::Transaction::RoleRefreshCache) { if (status == PackageKit::Transaction::ExitSuccess) { qCDebug(PLASMA_PK_UPDATES) << "Cache transaction finished successfully"; + + // save the timestamp + KConfigGroup grp(KSharedConfig::openConfig("plasma-pk-updates"), "General"); + grp.writeEntry("Timestamp", QDateTime::currentDateTime().toMSecsSinceEpoch()); + grp.sync(); + return; } else { qCDebug(PLASMA_PK_UPDATES) << "Cache transaction didn't finish successfully"; -- 2.15.0 ++++++ 0002-Show-that-the-last-check-failed-if-no-updates-availa.patch ++++++ >From b372eae9c7186797f62ba3cfb25d692075326d94 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fab...@ritter-vogt.de> Date: Mon, 25 Dec 2017 18:13:15 +0100 Subject: [PATCH 2/3] Show that the last check failed if no updates available Summary: If the last check for updates failed, it would be misleading to show that no updates are available. Test Plan: Ran pkupdates while YaST is open, instead of (incorrectly) showing that no updates are available, it shows that the last check failed. Reviewers: lukas, jgrulich Subscribers: plasma-devel Differential Revision: https://phabricator.kde.org/D9504 --- src/declarative/pkupdates.cpp | 10 ++++++++-- src/declarative/pkupdates.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/declarative/pkupdates.cpp b/src/declarative/pkupdates.cpp index f04c173..50265c9 100644 --- a/src/declarative/pkupdates.cpp +++ b/src/declarative/pkupdates.cpp @@ -134,6 +134,8 @@ QString PkUpdates::message() const return msg + "<br>" + i18n("(including %1)", extra.join(i18n(" and "))); } else if (!isNetworkOnline()) { return i18n("Your system is offline"); + } else if (!m_lastCheckSuccessful) { + return i18n("Checking for updates failed"); } return i18n("Your system is up to date"); @@ -345,7 +347,9 @@ void PkUpdates::onFinished(PackageKit::Transaction::Exit status, uint runtime) "in" << runtime/1000 << "seconds"; if (trans->role() == PackageKit::Transaction::RoleRefreshCache) { - if (status == PackageKit::Transaction::ExitSuccess) { + m_lastCheckSuccessful = status == PackageKit::Transaction::ExitSuccess; + + if (m_lastCheckSuccessful) { qCDebug(PLASMA_PK_UPDATES) << "Cache transaction finished successfully"; // save the timestamp @@ -359,7 +363,9 @@ void PkUpdates::onFinished(PackageKit::Transaction::Exit status, uint runtime) emit done(); } } else if (trans->role() == PackageKit::Transaction::RoleGetUpdates) { - if (status == PackageKit::Transaction::ExitSuccess) { + m_lastCheckSuccessful = status == PackageKit::Transaction::ExitSuccess; + + if (m_lastCheckSuccessful) { qCDebug(PLASMA_PK_UPDATES) << "Check updates transaction finished successfully"; const int upCount = count(); if (upCount > 0) { diff --git a/src/declarative/pkupdates.h b/src/declarative/pkupdates.h index 10eeea8..6bb1b83 100644 --- a/src/declarative/pkupdates.h +++ b/src/declarative/pkupdates.h @@ -227,6 +227,7 @@ private: QString m_statusMessage; int m_percentage = 0; Activity m_activity = Idle; + bool m_lastCheckSuccessful = false; }; #endif // PLASMA_PK_UPDATES_H -- 2.15.0 ++++++ 0003-List-known-updates-on-startup.patch ++++++ >From 3203b654db933f0e4b3085f243a01a710918c346 Mon Sep 17 00:00:00 2001 From: Fabian Vogt <fab...@ritter-vogt.de> Date: Tue, 26 Dec 2017 16:10:25 +0100 Subject: [PATCH 3/3] List known updates on startup Summary: Currently it's possible that it just says "No updates available" although PackageKit knows the opposite. This is because it doesn't even ask PK on startup. With this, it always lists available updates, only refreshing the cache if necessary. Test Plan: Ran plasmoidviewer, now lists available updates instead of "Your system is up to date". Reviewers: lukas, jgrulich Subscribers: plasma-devel Differential Revision: https://phabricator.kde.org/D9508 --- src/plasma/contents/ui/main.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plasma/contents/ui/main.qml b/src/plasma/contents/ui/main.qml index 387ae63..d667a5c 100644 --- a/src/plasma/contents/ui/main.qml +++ b/src/plasma/contents/ui/main.qml @@ -94,5 +94,10 @@ Item onIsOnBatteryChanged: timer.restart() } - Component.onCompleted: timer.start() + Component.onCompleted: { + if(!needsForcedUpdate() && batteryAllowed) { + PkUpdates.checkUpdates(false); + } + timer.start() + } } -- 2.15.0