powerdevil: drop Upstart support

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-06-01 03:09:51 +03:00
parent 2c964435bf
commit fb053eaa31
3 changed files with 1 additions and 31 deletions

View file

@ -32,10 +32,6 @@ qt4_add_dbus_interface(powerdevilupowerbackend_SRCS
${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_LIBS})
########################## Daemon variables ################################

View file

@ -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>

View file

@ -36,7 +36,6 @@
#include "xrandrbrightness.h"
#include "upowersuspendjob.h"
#include "login1suspendjob.h"
#include "upstart_interface.h"
bool checkSystemdVersion(uint requiredVersion)
{
@ -47,29 +46,12 @@ bool checkSystemdVersion(uint requiredVersion)
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";
kDebug() << "No appropriate systemd version found";
return false;
}