Hello community,

here is the log from the commit of package liblxqt for openSUSE:Factory checked 
in at 2017-09-13 22:38:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/liblxqt (Old)
 and      /work/SRC/openSUSE:Factory/.liblxqt.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "liblxqt"

Wed Sep 13 22:38:13 2017 rev:8 rq:525867 version:0.11.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/liblxqt/liblxqt.changes  2017-03-12 
19:58:58.224457968 +0100
+++ /work/SRC/openSUSE:Factory/.liblxqt.new/liblxqt.changes     2017-09-13 
22:38:31.638406844 +0200
@@ -1,0 +2,7 @@
+Wed Sep 13 11:47:59 UTC 2017 - [email protected]
+
+- boo#1044483:
+  * Add liblxqt-0.11.1-allow-disabl-lxqt-session.patch
+    to allow disabling of lxqt-session
+
+-------------------------------------------------------------------

New:
----
  liblxqt-0.11.1-allow-disabl-lxqt-session.patch

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

Other differences:
------------------
++++++ liblxqt.spec ++++++
--- /var/tmp/diff_new_pack.PempjW/_old  2017-09-13 22:38:32.166332513 +0200
+++ /var/tmp/diff_new_pack.PempjW/_new  2017-09-13 22:38:32.170331950 +0200
@@ -26,6 +26,7 @@
 Source:         
http://downloads.lxqt.org/lxqt/%{version}/%{name}-%{version}.tar.xz
 Source1:        
http://downloads.lxqt.org/lxqt/%{version}/%{name}-%{version}.tar.xz.asc
 Source2:        %{name}.keyring
+Patch0:         liblxqt-0.11.1-allow-disabl-lxqt-session.patch
 BuildRequires:  cmake >= 3.0.2
 BuildRequires:  fdupes
 BuildRequires:  gcc-c++
@@ -71,6 +72,7 @@
 
 %prep
 %setup -q -n liblxqt-%{version}
+%patch0 -p1
 
 %build
 %cmake -DPULL_TRANSLATIONS=No

++++++ liblxqt-0.11.1-allow-disabl-lxqt-session.patch ++++++
>From f3f824c85811596bc8886b86f31b5f37c2480736 Mon Sep 17 00:00:00 2001
From: Palo Kisa <[email protected]>
Date: Wed, 28 Jun 2017 09:25:43 +0200
Subject: [PATCH] lxqtpower: Allow disabling of lxqt-session provider

To allow usage of LXQt::Power object inside of lxqt-session (handling
the called method of LXQtSessionProvider) we need to avoid recurently
calling lxqt-session itself.
---
 lxqtpower/lxqtpower.cpp          | 10 ++++++++--
 lxqtpower/lxqtpower.h            | 12 ++++++++++--
 lxqtpower/lxqtpowerproviders.cpp | 36 +++++++++++++++++++++++++-----------
 3 files changed, 43 insertions(+), 15 deletions(-)

diff --git a/lxqtpower/lxqtpower.cpp b/lxqtpower/lxqtpower.cpp
index 742793b..07cd19e 100644
--- a/lxqtpower/lxqtpower.cpp
+++ b/lxqtpower/lxqtpower.cpp
@@ -33,15 +33,21 @@
 
 using namespace LXQt;
 
-Power::Power(QObject *parent) :
+Power::Power(bool useLxqtSessionProvider, QObject * parent /*= nullptr*/) :
     QObject(parent)
 {
     mProviders.append(new CustomProvider(this));
+    if (useLxqtSessionProvider)
+        mProviders.append(new LXQtProvider(this));
     mProviders.append(new SystemdProvider(this));
     mProviders.append(new UPowerProvider(this));
     mProviders.append(new ConsoleKitProvider(this));
     mProviders.append(new LxSessionProvider(this));
-    mProviders.append(new LXQtProvider(this));
+}
+
+Power::Power(QObject * parent /*= nullptr*/)
+    : Power(true, parent)
+{
 }
 
 
diff --git a/lxqtpower/lxqtpower.h b/lxqtpower/lxqtpower.h
index f738b46..98b021e 100644
--- a/lxqtpower/lxqtpower.h
+++ b/lxqtpower/lxqtpower.h
@@ -56,8 +56,16 @@ class LXQT_API Power : public QObject
         PowerSuspend    /// Suspend the computer
     };
 
-    /// Constructs a Power with parent.
-    explicit Power(QObject *parent = 0);
+    /*!
+     * Constructs the Power object.
+     * \param useLxqtSessionProvider indicates if the DBus methods
+     * provided by lxqt-session should be considered. This is useful to
+     * avoid recursion if the lxqt-session wants to provide some of the
+     * methods by itself with internal use of this object.
+     */
+    explicit Power(bool useLxqtSessionProvider, QObject *parent = nullptr);
+    /// Constructs a Power with using the lxqt-session provider.
+    explicit Power(QObject *parent = nullptr);
 
     /// Destroys the object.
     virtual ~Power();
diff --git a/lxqtpower/lxqtpowerproviders.cpp b/lxqtpower/lxqtpowerproviders.cpp
index 1304e05..3907cc7 100644
--- a/lxqtpower/lxqtpowerproviders.cpp
+++ b/lxqtpower/lxqtpowerproviders.cpp
@@ -500,31 +500,45 @@ LXQtProvider::~LXQtProvider()
 
 bool LXQtProvider::canAction(Power::Action action) const
 {
+    QString command;
     switch (action)
     {
         case Power::PowerLogout:
-            // there can be case when razo-session does not run
-            return dbusCall(LXQT_SERVICE, LXQT_PATH, LXQT_SERVICE,
-                            QDBusConnection::sessionBus(), "canLogout",
-                            PowerProvider::DontCheckDBUS);
+            command = "canLogout";
+            break;
+        case Power::PowerReboot:
+            command = "canReboot";
+            break;
+        case Power::PowerShutdown:
+            command = "canPowerOff";
+            break;
         default:
             return false;
     }
+
+    // there can be case when lxqtsession-session does not run
+    return dbusCall(LXQT_SERVICE, LXQT_PATH, LXQT_SERVICE,
+            QDBusConnection::sessionBus(), command,
+            PowerProvider::DontCheckDBUS);
 }
 
 
 bool LXQtProvider::doAction(Power::Action action)
 {
     QString command;
-
     switch (action)
     {
-    case Power::PowerLogout:
-        command = "logout";
-        break;
-
-    default:
-        return false;
+        case Power::PowerLogout:
+            command = "logout";
+            break;
+        case Power::PowerReboot:
+            command = "reboot";
+            break;
+        case Power::PowerShutdown:
+            command = "powerOff";
+            break;
+        default:
+            return false;
     }
 
     return dbusCall(LXQT_SERVICE,



Reply via email to