Hello community,

here is the log from the commit of package plasma5-pk-updates for 
openSUSE:Factory checked in at 2018-06-22 13:15:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/plasma5-pk-updates (Old)
 and      /work/SRC/openSUSE:Factory/.plasma5-pk-updates.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "plasma5-pk-updates"

Fri Jun 22 13:15:44 2018 rev:15 rq:616573 version:0.3.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/plasma5-pk-updates/plasma5-pk-updates.changes    
2018-06-02 11:52:40.542839438 +0200
+++ 
/work/SRC/openSUSE:Factory/.plasma5-pk-updates.new/plasma5-pk-updates.changes   
    2018-06-22 13:15:47.358134301 +0200
@@ -1,0 +2,7 @@
+Tue Jun 12 17:23:05 UTC 2018 - fab...@ritter-vogt.de
+
+- Add patch to hide the "Install updates" button on Tumbleweed as
+  the zypp PK backend can't handle it correctly:
+  * 0001-Hide-option-to-install-updates-on-Tumbleweed.patch
+
+-------------------------------------------------------------------

New:
----
  0001-Hide-option-to-install-updates-on-Tumbleweed.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ plasma5-pk-updates.spec ++++++
--- /var/tmp/diff_new_pack.U4ZZjv/_old  2018-06-22 13:15:48.402095590 +0200
+++ /var/tmp/diff_new_pack.U4ZZjv/_new  2018-06-22 13:15:48.410095293 +0200
@@ -24,6 +24,8 @@
 Group:          System/Packages
 Url:            http://www.kde.org
 Source:         
https://download.kde.org/stable/plasma-pk-updates/%{version}/plasma-pk-updates-%{version}.tar.xz
+# PATCH-FEATURE-OPENSUSE
+Patch100:       0001-Hide-option-to-install-updates-on-Tumbleweed.patch
 BuildRequires:  PackageKit-Qt5-devel
 BuildRequires:  cmake >= 3.0
 BuildRequires:  extra-cmake-modules >= 1.3.0
@@ -53,6 +55,7 @@
 %lang_package
 %prep
 %setup -q -n plasma-pk-updates-%{version}
+%autopatch -p1
 
 %build
   %cmake_kf5 -d build

++++++ 0001-Hide-option-to-install-updates-on-Tumbleweed.patch ++++++
>From 475d92af692c7bbba389c7b807ee27d843cdebb7 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fab...@ritter-vogt.de>
Date: Tue, 12 Jun 2018 19:21:43 +0200
Subject: [PATCH] Hide option to install updates on Tumbleweed

---
 src/declarative/pkupdates.cpp              | 16 ++++++++++++++++
 src/declarative/pkupdates.h                |  6 ++++++
 src/plasma/contents/ui/Full.qml            | 17 +++++++++++++++--
 src/plasma/contents/ui/PackageDelegate.qml |  2 ++
 4 files changed, 39 insertions(+), 2 deletions(-)

diff --git a/src/declarative/pkupdates.cpp b/src/declarative/pkupdates.cpp
index f8fd0ac..90bea08 100644
--- a/src/declarative/pkupdates.cpp
+++ b/src/declarative/pkupdates.cpp
@@ -20,6 +20,7 @@
 #include <limits.h>
 
 #include <QDebug>
+#include <QFile>
 #include <QTimer>
 #include <QDBusReply>
 #include <QDBusInterface>
@@ -179,6 +180,21 @@ bool PkUpdates::isOnBattery() const
     return Solid::PowerManagement::appShouldConserveResources();
 }
 
+bool PkUpdates::isTumbleweed() const
+{
+    QFile osRelease("/etc/os-release");
+    if(!osRelease.open(QIODevice::ReadOnly))
+        return false;
+
+    while(!osRelease.atEnd()) {
+        QByteArray line = osRelease.readLine();
+        if(line.startsWith("NAME=\"openSUSE Tumbleweed\""))
+            return true;
+    }
+
+    return false;
+}
+
 void PkUpdates::getUpdateDetails(const QString &pkgID)
 {
     qCDebug(PLASMA_PK_UPDATES) << "Requesting update details for" << pkgID;
diff --git a/src/declarative/pkupdates.h b/src/declarative/pkupdates.h
index 1f17da5..075da75 100644
--- a/src/declarative/pkupdates.h
+++ b/src/declarative/pkupdates.h
@@ -55,6 +55,7 @@ class PkUpdates : public QObject
     Q_PROPERTY(bool isNetworkOnline READ isNetworkOnline NOTIFY 
networkStateChanged)
     Q_PROPERTY(bool isNetworkMobile READ isNetworkMobile NOTIFY 
networkStateChanged)
     Q_PROPERTY(bool isOnBattery READ isOnBattery NOTIFY isOnBatteryChanged)
+    Q_PROPERTY(bool isTumbleweed READ isTumbleweed CONSTANT)
 
 public:
     enum Activity {Idle, CheckingUpdates, GettingUpdates, InstallingUpdates};
@@ -133,6 +134,11 @@ public:
      */
     bool isOnBattery() const;
 
+    /**
+     * @return whether /etc/os-release indicates openSUSE Tumbleweed
+     */
+    bool isTumbleweed() const;
+
 signals:
     /**
      * Emitted when the number uf updates has changed
diff --git a/src/plasma/contents/ui/Full.qml b/src/plasma/contents/ui/Full.qml
index eca7ec0..ca9b750 100644
--- a/src/plasma/contents/ui/Full.qml
+++ b/src/plasma/contents/ui/Full.qml
@@ -140,6 +140,7 @@ Item {
                 currentIndex: -1
                 boundsBehavior: Flickable.StopAtBounds
                 delegate: PackageDelegate {
+                    checkboxVisible: !PkUpdates.isTumbleweed
                     onClicked: {
                         if (updatesView.currentIndex === index) {
                             updatesView.currentIndex = -1
@@ -160,7 +161,7 @@ Item {
         }
 
         RowLayout {
-            visible: PkUpdates.count && !PkUpdates.isActive
+            visible: PkUpdates.count && !PkUpdates.isActive && 
!PkUpdates.isTumbleweed
             PlasmaComponents.CheckBox {
                 id: chkSelectAll
                 anchors {
@@ -218,7 +219,7 @@ Item {
 
         PlasmaComponents.Button {
             id: btnUpdate
-            visible: PkUpdates.count && PkUpdates.isNetworkOnline && 
!PkUpdates.isActive
+            visible: PkUpdates.count && PkUpdates.isNetworkOnline && 
!PkUpdates.isActive && !PkUpdates.isTumbleweed
             enabled: fullRepresentation.anySelected
             anchors {
                 bottom: parent.bottom
@@ -230,6 +231,18 @@ Item {
             onClicked: PkUpdates.installUpdates(selectedPackages())
         }
 
+        PlasmaComponents.Label {
+            id: lblUseZypper
+            visible: PkUpdates.count && PkUpdates.isNetworkOnline && 
!PkUpdates.isActive && PkUpdates.isTumbleweed
+            height: paintedHeight
+            anchors {
+                bottom: parent.bottom
+                horizontalCenter: parent.horizontalCenter
+            }
+            elide: Text.ElideRight;
+            text: i18n("Run 'zypper dup' manually to install updated 
packages.")
+        }
+
         PlasmaComponents.BusyIndicator {
             running: PkUpdates.isActive
             visible: running
diff --git a/src/plasma/contents/ui/PackageDelegate.qml 
b/src/plasma/contents/ui/PackageDelegate.qml
index 678d21d..9f8aaf7 100644
--- a/src/plasma/contents/ui/PackageDelegate.qml
+++ b/src/plasma/contents/ui/PackageDelegate.qml
@@ -32,6 +32,7 @@ PlasmaComponents.ListItem {
     property string updateText
     property variant updateUrls: []
     readonly property bool expanded: ListView.isCurrentItem
+    property alias checkboxVisible: checkbox.visible
 
     signal checkedStateChanged(bool checked)
 
@@ -42,6 +43,7 @@ PlasmaComponents.ListItem {
 
     PlasmaComponents.CheckBox {
         id: checkbox
+        width: checkboxVisible ? implicitWidth : 0
         anchors {
             left: parent.left
             verticalCenter: packageInfoColumn.verticalCenter
-- 
2.16.2


Reply via email to