commit kdebase4-workspace for openSUSE:Factory
Hello community, here is the log from the commit of package kdebase4-workspace for openSUSE:Factory checked in at 2013-03-01 10:48:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kdebase4-workspace (Old) and /work/SRC/openSUSE:Factory/.kdebase4-workspace.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "kdebase4-workspace", Maintainer is "kde-maintainers@suse.de" Changes: -------- --- /work/SRC/openSUSE:Factory/kdebase4-workspace/kdebase4-workspace.changes 2013-02-23 08:08:04.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.kdebase4-workspace.new/kdebase4-workspace.changes 2013-03-01 10:48:30.000000000 +0100 @@ -1,0 +2,12 @@ +Thu Feb 28 16:03:32 UTC 2013 - wbauer@tmo.at + +- Change default Bootmanager to "Grub2" in kdmrc (bnc#788867) + +------------------------------------------------------------------- +Thu Feb 28 04:06:11 UTC 2013 - crrodriguez@opensuse.org + +- Add powerdevil-logind.patch, allows powerdevil to + interact properly with systemd-logind + (https://git.reviewboard.kde.org/r/108407) + +------------------------------------------------------------------- New: ---- powerdevil-logind.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ kdebase4-workspace.spec ++++++ --- /var/tmp/diff_new_pack.PA1pq4/_old 2013-03-01 10:48:33.000000000 +0100 +++ /var/tmp/diff_new_pack.PA1pq4/_new 2013-03-01 10:48:33.000000000 +0100 @@ -125,6 +125,8 @@ # Downside is that ConsoleKit is no longer supported and requires that NetworkManager and PolKit # are also both build with systemd support. Not activated at the moment due to sysvinit fallback!! Patch214: workspace_systemd_initial_support.patch +#PATCH-FIX-OPENSUSE (?) Make powerdevil understand/talk with systemd-logind +Patch215: powerdevil-logind.patch %endif # Patch from Fedora to enable plymouth support in KDM. # Patch is based on the changes within GDM to detect running plymouth @@ -385,6 +387,7 @@ %patch213 -p1 %if %{with_systemd} %patch214 -p1 +%patch215 -p1 %endif %patch400 -p0 %patch401 -p1 ++++++ kdm-sysconfig-values.diff ++++++ --- /var/tmp/diff_new_pack.PA1pq4/_old 2013-03-01 10:48:34.000000000 +0100 +++ /var/tmp/diff_new_pack.PA1pq4/_new 2013-03-01 10:48:34.000000000 +0100 @@ -128,7 +128,7 @@ Burg/BO_BURG: Burg boot manager Lilo/BO_LILO: Lilo boot manager (Linux on i386 & x86-64 only) -Default: None -+Default: Grub ++Default: Grub2 User: core User: greeter Instance: #Grub ++++++ powerdevil-logind.patch ++++++ diff --git a/powerdevil/daemon/BackendConfig.cmake b/powerdevil/daemon/BackendConfig.cmake index 5dbe6f6..5344925 100644 --- a/powerdevil/daemon/BackendConfig.cmake +++ b/powerdevil/daemon/BackendConfig.cmake @@ -9,6 +9,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/backends/upower set(powerdevilupowerbackend_SRCS backends/upower/upowersuspendjob.cpp + backends/upower/login1suspendjob.cpp backends/upower/powerdevilupowerbackend.cpp backends/upower/xrandrbrightness.cpp ) diff --git a/powerdevil/daemon/backends/upower/login1suspendjob.h b/powerdevil/daemon/backends/upower/login1suspendjob.h new file mode 100644 index 0000000..c7e33ba --- /dev/null +++ b/powerdevil/daemon/backends/upower/login1suspendjob.h @@ -0,0 +1,54 @@ +/* This file is part of the KDE project + Copyright (C) 2006 Kevin Ottens <ervin@kde.org> + Copyright (C) 2010 Alejandro Fiestas <alex@eyeos.org> + Copyright (C) 2013 Lukáš Tinkl <ltinkl@redhat.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + +*/ + +#ifndef LOGIN1SUSPENDJOB_H +#define LOGIN1SUSPENDJOB_H + +#include <kjob.h> +#include <QtDBus/QDBusInterface> +#include <QtDBus/QDBusMessage> +#include <QtDBus/QDBusPendingCallWatcher> + +#include "powerdevilbackendinterface.h" + +class Login1SuspendJob : public KJob +{ + Q_OBJECT +public: + Login1SuspendJob(QDBusInterface *login1Interface, + PowerDevil::BackendInterface::SuspendMethod method, + PowerDevil::BackendInterface::SuspendMethods supported); + virtual ~Login1SuspendJob(); + + void start(); + void kill(bool quietly); + +private Q_SLOTS: + void doStart(); + void sendResult(QDBusPendingCallWatcher* watcher); + +private: + QDBusInterface *m_login1Interface; + PowerDevil::BackendInterface::SuspendMethod m_method; + PowerDevil::BackendInterface::SuspendMethods m_supported; +}; + +#endif //LOGIN1SUSPENDJOB_H diff --git a/powerdevil/daemon/backends/upower/login1suspendjob.cpp b/powerdevil/daemon/backends/upower/login1suspendjob.cpp new file mode 100644 index 0000000..3ec0ddc --- /dev/null +++ b/powerdevil/daemon/backends/upower/login1suspendjob.cpp @@ -0,0 +1,99 @@ +/* This file is part of the KDE project + Copyright (C) 2006 Kevin Ottens <ervin@kde.org> + Copyright (C) 2010 Alejandro Fiestas <alex@eyeos.org> + Copyright (C) 2013 Lukáš Tinkl <ltinkl@redhat.com> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + +*/ + +#include "login1suspendjob.h" + +#include <QtDBus/QDBusMessage> +#include <QtDBus/QDBusReply> +#include <QTimer> +#include <KDebug> +#include <KLocale> + +Login1SuspendJob::Login1SuspendJob(QDBusInterface *login1Interface, + PowerDevil::BackendInterface::SuspendMethod method, + PowerDevil::BackendInterface::SuspendMethods supported) + : KJob(), m_login1Interface(login1Interface) +{ + kDebug() << "Starting Login1 suspend job"; + m_method = method; + m_supported = supported; +} + +Login1SuspendJob::~Login1SuspendJob() +{ + +} + +void Login1SuspendJob::start() +{ + QTimer::singleShot(0, this, SLOT(doStart())); +} + +void Login1SuspendJob::kill(bool /*quietly */) +{ + +} + +void Login1SuspendJob::doStart() +{ + if (m_supported & m_method) + { + QVariantList args; + args << true; // interactive, ie. with polkit dialogs + + QDBusPendingReply<void> reply; + QDBusPendingCallWatcher *watcher = new QDBusPendingCallWatcher(reply, this); + connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(sendResult(QDBusPendingCallWatcher*))); + + switch(m_method) + { + case PowerDevil::BackendInterface::ToRam: + reply = m_login1Interface->asyncCallWithArgumentList("Suspend", args); + break; + case PowerDevil::BackendInterface::ToDisk: + reply = m_login1Interface->asyncCallWithArgumentList("Hibernate", args); + break; + case PowerDevil::BackendInterface::HybridSuspend: + reply = m_login1Interface->asyncCallWithArgumentList("HybridSleep", args); + break; + default: + kDebug() << "Unsupported suspend method"; + setError(1); + setErrorText(i18n("Unsupported suspend method")); + break; + } + } +} + +void Login1SuspendJob::sendResult(QDBusPendingCallWatcher *watcher) +{ + const QDBusPendingReply<void> reply = *watcher; + if (!reply.isError()) { + emitResult(); + } else { + kWarning() << "Failed to start suspend job" << reply.error().name() << reply.error().message(); + } + + watcher->deleteLater(); +} + + +#include "login1suspendjob.moc" diff --git a/powerdevil/daemon/backends/upower/powerdevilupowerbackend.h b/powerdevil/daemon/backends/upower/powerdevilupowerbackend.h index ba942bd..ae3d754 100644 --- a/powerdevil/daemon/backends/upower/powerdevilupowerbackend.h +++ b/powerdevil/daemon/backends/upower/powerdevilupowerbackend.h @@ -34,6 +34,7 @@ #include "upower_kbdbacklight_interface.h" #define UPOWER_SERVICE "org.freedesktop.UPower" +#define LOGIN1_SERVICE "org.freedesktop.login1" class XRandrBrightness; @@ -63,6 +64,7 @@ private slots: void slotDeviceRemoved(const QString &); void slotDeviceChanged(const QString &); void slotPropertyChanged(); + void slotLogin1Resuming(bool active); private: // upower devices @@ -74,6 +76,9 @@ private: OrgFreedesktopUPowerInterface *m_upowerInterface; OrgFreedesktopUPowerKbdBacklightInterface *m_kbdBacklight; + // login1 interface + QWeakPointer<QDBusInterface> m_login1Interface; + // buttons bool m_lidIsPresent; bool m_lidIsClosed; diff --git a/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp b/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp index 97a409b..f9503b3 100644 --- a/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp +++ b/powerdevil/daemon/backends/upower/powerdevilupowerbackend.cpp @@ -2,7 +2,7 @@ Copyright (C) 2006 Kevin Ottens <ervin@kde.org> Copyright (C) 2008-2010 Dario Freddi <drf@kde.org> Copyright (C) 2010 Alejandro Fiestas <alex@eyeos.org> - Copyright (C) 2010 Lukas Tinkl <ltinkl@redhat.com> + Copyright (C) 2010-2013 Lukáš Tinkl <ltinkl@redhat.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -31,6 +31,7 @@ #include "xrandrbrightness.h" #include "upowersuspendjob.h" +#include "login1suspendjob.h" #define HELPER_ID "org.kde.powerdevil.backlighthelper" @@ -39,6 +40,7 @@ PowerDevilUPowerBackend::PowerDevilUPowerBackend(QObject* parent) m_brightnessControl(0), m_lidIsPresent(false), m_lidIsClosed(false), m_onBattery(false) { + } PowerDevilUPowerBackend::~PowerDevilUPowerBackend() @@ -80,11 +82,19 @@ bool PowerDevilUPowerBackend::isAvailable() void PowerDevilUPowerBackend::init() { // interfaces + if (!QDBusConnection::systemBus().interface()->isServiceRegistered(LOGIN1_SERVICE)) { + // Activate it. + QDBusConnection::systemBus().interface()->startService(LOGIN1_SERVICE); + } + if (!QDBusConnection::systemBus().interface()->isServiceRegistered(UPOWER_SERVICE)) { // Activate it. QDBusConnection::systemBus().interface()->startService(UPOWER_SERVICE); } + if (QDBusConnection::systemBus().interface()->isServiceRegistered(LOGIN1_SERVICE)) { + m_login1Interface = new QDBusInterface(LOGIN1_SERVICE, "/org/freedesktop/login1", "org.freedesktop.login1.Manager", QDBusConnection::systemBus(), this); + } m_upowerInterface = new OrgFreedesktopUPowerInterface(UPOWER_SERVICE, "/org/freedesktop/UPower", QDBusConnection::systemBus(), this); m_kbdBacklight = new OrgFreedesktopUPowerKbdBacklightInterface(UPOWER_SERVICE, "/org/freedesktop/UPower/KbdBacklight", QDBusConnection::systemBus(), this); m_brightnessControl = new XRandrBrightness(); @@ -113,7 +123,22 @@ void PowerDevilUPowerBackend::init() // Supported suspend methods SuspendMethods supported = UnknownSuspendMethod; - { + if (m_login1Interface) { + QDBusPendingReply<QString> canSuspend = m_login1Interface.data()->asyncCall("CanSuspend"); + canSuspend.waitForFinished(); + if (canSuspend.isValid() && (canSuspend.value() == "yes" || canSuspend.value() == "challenge")) + supported |= ToRam; + + QDBusPendingReply<QString> canHibernate = m_login1Interface.data()->asyncCall("CanHibernate"); + canHibernate.waitForFinished(); + if (canHibernate.isValid() && (canHibernate.value() == "yes" || canHibernate.value() == "challenge")) + supported |= ToDisk; + + QDBusPendingReply<QString> canHybridSleep = m_login1Interface.data()->asyncCall("CanHybridSleep"); + canHybridSleep.waitForFinished(); + if (canHybridSleep.isValid() && (canHybridSleep.value() == "yes" || canHybridSleep.value() == "challenge")) + supported |= HybridSuspend; + } else { if (m_upowerInterface->canSuspend() && m_upowerInterface->SuspendAllowed()) { kDebug() << "Can suspend"; supported |= ToRam; @@ -125,7 +150,16 @@ void PowerDevilUPowerBackend::init() } } - connect(m_upowerInterface, SIGNAL(Resuming()), this, SIGNAL(resumeFromSuspend())); + // "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) { + connect(m_login1Interface.data(), SIGNAL(PrepareForSleep(bool)), this, SLOT(slotLogin1Resuming(bool))); + } else { + connect(m_upowerInterface, SIGNAL(Resuming()), this, SIGNAL(resumeFromSuspend())); + } // battery QList<RecallNotice> recallList; @@ -246,7 +280,11 @@ bool PowerDevilUPowerBackend::setBrightness(float brightnessValue, PowerDevil::B KJob* PowerDevilUPowerBackend::suspend(PowerDevil::BackendInterface::SuspendMethod method) { - return new UPowerSuspendJob(m_upowerInterface, method, supportedSuspendMethods()); + if (m_login1Interface) { + return new Login1SuspendJob(m_login1Interface.data(), method, supportedSuspendMethods()); + } else { + return new UPowerSuspendJob(m_upowerInterface, method, supportedSuspendMethods()); + } } void PowerDevilUPowerBackend::enumerateDevices() @@ -337,4 +375,11 @@ void PowerDevilUPowerBackend::slotPropertyChanged() m_onBattery = onBattery; } +void PowerDevilUPowerBackend::slotLogin1Resuming(bool active) +{ + if (!active) { + emit resumeFromSuspend(); + } +} + #include "powerdevilupowerbackend.moc" diff --git a/powerdevil/daemon/backends/upower/upowersuspendjob.h b/powerdevil/daemon/backends/upower/upowersuspendjob.h index bbe2f45..aac4b12 100644 --- a/powerdevil/daemon/backends/upower/upowersuspendjob.h +++ b/powerdevil/daemon/backends/upower/upowersuspendjob.h @@ -25,7 +25,7 @@ #include <QtDBus/QDBusInterface> #include <QtDBus/QDBusMessage> -#include "powerdevilupowerbackend.h" +#include "powerdevilbackendinterface.h" class OrgFreedesktopUPowerInterface; @@ -34,8 +34,8 @@ class UPowerSuspendJob : public KJob Q_OBJECT public: UPowerSuspendJob(OrgFreedesktopUPowerInterface *upowerInterface, - PowerDevil::BackendInterface::SuspendMethod method, - PowerDevil::BackendInterface::SuspendMethods supported); + PowerDevil::BackendInterface::SuspendMethod method, + PowerDevil::BackendInterface::SuspendMethods supported); virtual ~UPowerSuspendJob(); void start(); diff --git a/powerdevil/daemon/backends/upower/upowersuspendjob.cpp b/powerdevil/daemon/backends/upower/upowersuspendjob.cpp index 536a7e1..08a850a 100644 --- a/powerdevil/daemon/backends/upower/upowersuspendjob.cpp +++ b/powerdevil/daemon/backends/upower/upowersuspendjob.cpp @@ -25,7 +25,6 @@ #include <QtDBus/QDBusMessage> #include <QtDBus/QDBusReply> #include <QTimer> -#include <KConfig> #include <KDebug> #include <KLocale> @@ -34,7 +33,7 @@ UPowerSuspendJob::UPowerSuspendJob(OrgFreedesktopUPowerInterface *upowerInterfac PowerDevil::BackendInterface::SuspendMethods supported) : KJob(), m_upowerInterface(upowerInterface) { - kDebug() << "Stancing Suspend job"; + kDebug() << "Starting UPower suspend job"; m_method = method; m_supported = supported; -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@hilbert.suse.de