[packages/kde4-kdebase-workspace] - rel 4; allow suspend/resume with older systemd, too
arekm
arekm at pld-linux.org
Wed Mar 13 21:41:42 CET 2013
commit 675cce2338ff3db4470d70222ec667e9be3d4f74
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Mar 13 21:41:39 2013 +0100
- rel 4; allow suspend/resume with older systemd, too
git.patch | 116 ++++++++++++++++++++++++++++++++++++++++++++
kde4-kdebase-workspace.spec | 4 +-
2 files changed, 119 insertions(+), 1 deletion(-)
---
diff --git a/kde4-kdebase-workspace.spec b/kde4-kdebase-workspace.spec
index 336a9fd..be55894 100644
--- a/kde4-kdebase-workspace.spec
+++ b/kde4-kdebase-workspace.spec
@@ -8,7 +8,7 @@ Summary: KDE 4 base workspace components
Summary(pl.UTF-8): Podstawowe komponenty środowiska KDE 4
Name: kde4-kdebase-workspace
Version: 4.10.1
-Release: 3
+Release: 4
License: GPL v2+
Group: X11/Applications
Source0: ftp://ftp.kde.org/pub/kde/%{_state}/%{version}/src/%{orgname}-%{version}.tar.xz
@@ -31,6 +31,7 @@ Patch0: %{name}-rootprivs.patch
Patch1: %{name}-kdmconfig.patch
Patch2: %{name}-kdm_revertcrashlogic.patch
Patch3: kde4-kdebase-workspace-brightness.patch
+Patch4: git.patch
URL: http://www.kde.org/
BuildRequires: ConsoleKit-devel
BuildRequires: Mesa-libGLES-devel
@@ -536,6 +537,7 @@ dialogowych mających na celu rozszerzenie przywilejów użytkownika.
# https://bugs.kde.org/show_bug.cgi?id=281862
#%patch2 -p1
#%patch3 -p1
+%patch4 -p1
%build
install -d build
diff --git a/git.patch b/git.patch
new file mode 100644
index 0000000..6715525
--- /dev/null
+++ b/git.patch
@@ -0,0 +1,116 @@
+From: Raymond Wooninck <tittiatcoke at gmail.com>
+Date: Thu, 07 Mar 2013 11:46:03 +0000
+Subject: Also check if the version of systemd is supporting the upower functions
+X-Git-Url: http://quickgit.kde.org/?p=kde-workspace.git&a=commitdiff&h=cc59979ffce8a01076fd9ffe76910b16756d8d87
+---
+Also check if the version of systemd is supporting the upower functions
+
+BUG: 316219
+REVIEW: 109336
+---
+
+
+--- a/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp
++++ b/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp
+@@ -34,6 +34,21 @@
+ #include "login1suspendjob.h"
+
+ #define HELPER_ID "org.kde.powerdevil.backlighthelper"
++
++bool checkSystemdVersion(uint requiredVersion)
++{
++ bool ok;
++
++ QDBusInterface systemdIface("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager",
++ QDBusConnection::systemBus(), 0);
++ uint version = systemdIface.property("Version").toString().section(' ', 1).toUInt(&ok);
++ if (ok) {
++ return (version >= requiredVersion);
++ } else {
++ kDebug() << "Unknown version string from Systemd";
++ return false;
++ }
++}
+
+ PowerDevilUPowerBackend::PowerDevilUPowerBackend(QObject* parent)
+ : BackendInterface(parent),
+@@ -123,7 +138,7 @@
+
+ // Supported suspend methods
+ SuspendMethods supported = UnknownSuspendMethod;
+- if (m_login1Interface) {
++ if (m_login1Interface && checkSystemdVersion(195)) {
+ QDBusPendingReply<QString> canSuspend = m_login1Interface.data()->asyncCall("CanSuspend");
+ canSuspend.waitForFinished();
+ if (canSuspend.isValid() && (canSuspend.value() == "yes" || canSuspend.value() == "challenge"))
+@@ -151,11 +166,7 @@
+ }
+
+ // "resuming" signal
+- QDBusInterface systemdIface("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager",
+- QDBusConnection::systemBus(), this);
+- int version = systemdIface.property("Version").toString().section(' ', 1).toInt();
+-
+- if (m_login1Interface && version > 197) {
++ if (m_login1Interface && checkSystemdVersion(198)) {
+ connect(m_login1Interface.data(), SIGNAL(PrepareForSleep(bool)), this, SLOT(slotLogin1Resuming(bool)));
+ } else {
+ connect(m_upowerInterface, SIGNAL(Resuming()), this, SIGNAL(resumeFromSuspend()));
+@@ -280,7 +291,7 @@
+
+ KJob* PowerDevilUPowerBackend::suspend(PowerDevil::BackendInterface::SuspendMethod method)
+ {
+- if (m_login1Interface) {
++ if (m_login1Interface && checkSystemdVersion(195)) {
+ return new Login1SuspendJob(m_login1Interface.data(), method, supportedSuspendMethods());
+ } else {
+ return new UPowerSuspendJob(m_upowerInterface, method, supportedSuspendMethods());
+
+From: Lukáš Tinkl <lukas at kde.org>
+Date: Tue, 12 Mar 2013 16:01:00 +0000
+Subject: stop leaking the login1 suspend job
+X-Git-Url: http://quickgit.kde.org/?p=kde-workspace.git&a=commitdiff&h=7a01d55b55591fb3d73281541116b36e72f49e24
+---
+stop leaking the login1 suspend job
+
+BUG: 316473
+FIXED-IN: 4.10.2
+---
+
+
+--- a/powerdevil/daemon/backends/upower/login1suspendjob.cpp
++++ b/powerdevil/daemon/backends/upower/login1suspendjob.cpp
+@@ -35,6 +35,8 @@
+ kDebug() << "Starting Login1 suspend job";
+ m_method = method;
+ m_supported = supported;
++
++ connect(m_login1Interface, SIGNAL(PrepareForSleep(bool)), this, SLOT(slotLogin1Resuming(bool)));
+ }
+
+ Login1SuspendJob::~Login1SuspendJob()
+@@ -95,6 +97,12 @@
+ watcher->deleteLater();
+ }
+
++void Login1SuspendJob::slotLogin1Resuming(bool active)
++{
++ if (!active)
++ emitResult();
++}
++
+
+ #include "login1suspendjob.moc"
+
+
+--- a/powerdevil/daemon/backends/upower/login1suspendjob.h
++++ b/powerdevil/daemon/backends/upower/login1suspendjob.h
+@@ -44,6 +44,7 @@
+ private Q_SLOTS:
+ void doStart();
+ void sendResult(QDBusPendingCallWatcher* watcher);
++ void slotLogin1Resuming(bool active);
+
+ private:
+ QDBusInterface *m_login1Interface;
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/kde4-kdebase-workspace.git/commitdiff/675cce2338ff3db4470d70222ec667e9be3d4f74
More information about the pld-cvs-commit
mailing list