mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 10:52:51 +00:00
powerdevil: drop Upstart support
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
2c964435bf
commit
fb053eaa31
3 changed files with 1 additions and 31 deletions
|
@ -32,10 +32,6 @@ qt4_add_dbus_interface(powerdevilupowerbackend_SRCS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/backends/upower/dbus/org.freedesktop.UPower.KbdBacklight.xml
|
${CMAKE_CURRENT_SOURCE_DIR}/backends/upower/dbus/org.freedesktop.UPower.KbdBacklight.xml
|
||||||
upower_kbdbacklight_interface)
|
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_LIBS})
|
set(powerdevilupowerbackend_LIBS ${X11_LIBRARIES} ${QT_QTGUI_LIBRARY} ${X11_Xrandr_LIB} ${KDE4_KDEUI_LIBS})
|
||||||
|
|
||||||
########################## Daemon variables ################################
|
########################## Daemon variables ################################
|
||||||
|
|
|
@ -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>
|
|
||||||
|
|
|
@ -36,7 +36,6 @@
|
||||||
#include "xrandrbrightness.h"
|
#include "xrandrbrightness.h"
|
||||||
#include "upowersuspendjob.h"
|
#include "upowersuspendjob.h"
|
||||||
#include "login1suspendjob.h"
|
#include "login1suspendjob.h"
|
||||||
#include "upstart_interface.h"
|
|
||||||
|
|
||||||
bool checkSystemdVersion(uint requiredVersion)
|
bool checkSystemdVersion(uint requiredVersion)
|
||||||
{
|
{
|
||||||
|
@ -47,29 +46,12 @@ bool checkSystemdVersion(uint requiredVersion)
|
||||||
const QString reply = systemdIface.property("Version").toString();
|
const QString reply = systemdIface.property("Version").toString();
|
||||||
|
|
||||||
QRegExp expsd("(systemd )?([0-9]+)");
|
QRegExp expsd("(systemd )?([0-9]+)");
|
||||||
|
|
||||||
if (expsd.exactMatch(reply)) {
|
if (expsd.exactMatch(reply)) {
|
||||||
const uint version = expsd.cap(2).toUInt();
|
const uint version = expsd.cap(2).toUInt();
|
||||||
return (version >= requiredVersion);
|
return (version >= requiredVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since version 1.11 Upstart user sessions implement the exact same API as logind
|
kDebug() << "No appropriate systemd version found";
|
||||||
// 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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue