Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:wkazubski:KDE4
kdebase4-workspace
powerdevil-Remove-systemd-version-checks.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File powerdevil-Remove-systemd-version-checks.patch of Package kdebase4-workspace
From 433263359ff20f6fe1a09f27b01887988c77129b Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik <kde@privat.broulik.de> Date: Mon, 15 Dec 2014 22:06:22 +0100 Subject: [PATCH] Remove systemd version checks Given systemd 195 and 198 were released in October 2012 and March 2013, respectively, it should be safe to remove them. This makes it more predictable when PowerDevil will use the logind interface to suspend the session. REVIEW: 121537 --- daemon/BackendConfig.cmake | 4 -- .../upower/dbus/com.ubuntu.Upstart.xml | 8 ---- .../upower/powerdevilupowerbackend.cpp | 42 ++----------------- 3 files changed, 3 insertions(+), 51 deletions(-) delete mode 100644 daemon/backends/upower/dbus/com.ubuntu.Upstart.xml diff --git a/powerdevil/daemon/BackendConfig.cmake b/powerdevil/daemon/BackendConfig.cmake index 4d2e7775..295a8a2b 100644 --- a/powerdevil/daemon/BackendConfig.cmake +++ b/powerdevil/daemon/BackendConfig.cmake @@ -35,10 +35,6 @@ if (UDEV_FOUND) ${CMAKE_CURRENT_SOURCE_DIR}/backends/upower/dbus/org.freedesktop.UPower.KbdBacklight.xml upower_kbdbacklight_interface) - qt4_add_dbus_interface(powerdevilupowerbackend_SRCS - ${CMAKE_CURRENT_SOURCE_DIR}/backends/upower/dbus/com.ubuntu.Upstart.xml - upstart_interface) - set(powerdevilupowerbackend_LIBS ${X11_LIBRARIES} ${QT_QTGUI_LIBRARY} ${X11_Xrandr_LIB} ${KDE4_KDEUI_LIBRARY} ${UDEV_LIBS}) ## backlight helper executable diff --git a/powerdevil/daemon/backends/upower/dbus/com.ubuntu.Upstart.xml b/powerdevil/daemon/backends/upower/dbus/com.ubuntu.Upstart.xml deleted file mode 100644 index dc7ae42d..00000000 --- a/powerdevil/daemon/backends/upower/dbus/com.ubuntu.Upstart.xml +++ /dev/null @@ -1,8 +0,0 @@ -<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" -"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> -<node name="/com/ubuntu/Upstart"> - <interface name="com.ubuntu.Upstart0_6"> - <property name="version" type="s" access="read"/> - </interface> -</node> - diff --git a/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp b/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp index 263788d0..97c9a994 100644 --- a/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp +++ b/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp @@ -33,46 +33,10 @@ #include "xrandrbrightness.h" #include "upowersuspendjob.h" #include "login1suspendjob.h" -#include "upstart_interface.h" #include "udevqt.h" #define HELPER_ID "org.kde.powerdevil.backlighthelper" -bool checkSystemdVersion(uint requiredVersion) -{ - - QDBusInterface systemdIface("org.freedesktop.systemd1", "/org/freedesktop/systemd1", "org.freedesktop.systemd1.Manager", - QDBusConnection::systemBus(), 0); - - const QString reply = systemdIface.property("Version").toString(); - - QRegExp expsd("(systemd )?([0-9]+)"); - - if (expsd.exactMatch(reply)) { - const uint version = expsd.cap(2).toUInt(); - return (version >= requiredVersion); - } - - // Since version 1.11 Upstart user sessions implement the exact same API as logind - // and are going to the maintain the API in future releases. - // Hence, powerdevil can support this init system as well - // This has no effect on systemd integration since the check is done after systemd - ComUbuntuUpstart0_6Interface upstartInterface(QLatin1String("com.ubuntu.Upstart"), - QLatin1String("/com/ubuntu/Upstart"), - QDBusConnection::sessionBus()); - - QRegExp exp("(?:init \\()?upstart ([0-9.]+)(?:\\))?"); - if(exp.exactMatch(upstartInterface.version())) { - // Only keep the X.Y part of a X.Y.Z version - QStringList items = exp.cap(1).split('.').mid(0, 2); - const float upstartVersion = items.join(QString('.')).toFloat(); - return upstartVersion >= 1.1; - } - - kDebug() << "No appropriate systemd version or upstart version found"; - return false; -} - PowerDevilUPowerBackend::PowerDevilUPowerBackend(QObject* parent) : BackendInterface(parent), m_brightnessControl(0), m_kbdMaxBrightness(0), @@ -231,7 +195,7 @@ void PowerDevilUPowerBackend::init() // Supported suspend methods SuspendMethods supported = UnknownSuspendMethod; - if (m_login1Interface && checkSystemdVersion(195)) { + if (m_login1Interface) { QDBusPendingReply<QString> canSuspend = m_login1Interface.data()->asyncCall("CanSuspend"); canSuspend.waitForFinished(); if (canSuspend.isValid() && (canSuspend.value() == "yes" || canSuspend.value() == "challenge")) @@ -259,7 +223,7 @@ void PowerDevilUPowerBackend::init() } // "resuming" signal - if (m_login1Interface && checkSystemdVersion(198)) { + if (m_login1Interface) { connect(m_login1Interface.data(), SIGNAL(PrepareForSleep(bool)), this, SLOT(slotLogin1Resuming(bool))); } else { connect(m_upowerInterface, SIGNAL(Resuming()), this, SIGNAL(resumeFromSuspend())); @@ -431,7 +395,7 @@ void PowerDevilUPowerBackend::onKeyboardBrightnessChanged(int value) KJob* PowerDevilUPowerBackend::suspend(PowerDevil::BackendInterface::SuspendMethod method) { - if (m_login1Interface && checkSystemdVersion(195)) { + if (m_login1Interface) { return new Login1SuspendJob(m_login1Interface.data(), method, supportedSuspendMethods()); } else { return new UPowerSuspendJob(m_upowerInterface, method, supportedSuspendMethods()); -- GitLab
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor