diff options
author | Samuli Suominen <ssuominen@gentoo.org> | 2009-12-07 15:34:47 +0000 |
---|---|---|
committer | Samuli Suominen <ssuominen@gentoo.org> | 2009-12-07 15:34:47 +0000 |
commit | 0b7f6714f5d101d1d3e4e4bde4fc731ad8bbe2ce (patch) | |
tree | 5bcca9982f14ad66885a57b01575572101f83cfb /kde-base/solid | |
parent | Add patch to fix plasma crash on kde4. Bug #296003 (diff) | |
download | gentoo-2-0b7f6714f5d101d1d3e4e4bde4fc731ad8bbe2ce.tar.gz gentoo-2-0b7f6714f5d101d1d3e4e4bde4fc731ad8bbe2ce.tar.bz2 gentoo-2-0b7f6714f5d101d1d3e4e4bde4fc731ad8bbe2ce.zip |
Fix crash in Solid::Control::PowerManager::brightness wrt #295600, thanks to Magnus Kessler.
(Portage version: 2.2_rc56/cvs/Linux x86_64)
Diffstat (limited to 'kde-base/solid')
-rw-r--r-- | kde-base/solid/ChangeLog | 9 | ||||
-rw-r--r-- | kde-base/solid/files/solid-4.3.4-hal.patch | 115 | ||||
-rw-r--r-- | kde-base/solid/solid-4.3.4-r1.ebuild | 40 |
3 files changed, 163 insertions, 1 deletions
diff --git a/kde-base/solid/ChangeLog b/kde-base/solid/ChangeLog index ebed7811a4d3..aeb617c8afdf 100644 --- a/kde-base/solid/ChangeLog +++ b/kde-base/solid/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for kde-base/solid # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/solid/ChangeLog,v 1.47 2009/12/01 11:32:45 wired Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/solid/ChangeLog,v 1.48 2009/12/07 15:34:47 ssuominen Exp $ + +*solid-4.3.4-r1 (07 Dec 2009) + + 07 Dec 2009; Samuli Suominen <ssuominen@gentoo.org> + +solid-4.3.4-r1.ebuild, +files/solid-4.3.4-hal.patch: + Fix crash in Solid::Control::PowerManager::brightness wrt #295600, thanks + to Magnus Kessler. *solid-4.3.4 (01 Dec 2009) diff --git a/kde-base/solid/files/solid-4.3.4-hal.patch b/kde-base/solid/files/solid-4.3.4-hal.patch new file mode 100644 index 000000000000..1bc66eabf1e9 --- /dev/null +++ b/kde-base/solid/files/solid-4.3.4-hal.patch @@ -0,0 +1,115 @@ +http://bugs.gentoo.org/show_bug.cgi?id=295600 + +http://websvn.kde.org/trunk/KDE/kdebase/workspace/solid/hal/halpower.cpp?r1=929945&r2=1035622&pathrev=1057980 +http://websvn.kde.org/trunk/KDE/kdebase/workspace/solid/hal/halpower.cpp?r1=1035622&r2=1057980&pathrev=1057980 + +diff -ur kdebase-workspace-4.3.4.orig/solid/hal/halpower.cpp kdebase-workspace-4.3.4/solid/hal/halpower.cpp +--- kdebase-workspace-4.3.4.orig/solid/hal/halpower.cpp 2009-02-26 11:12:20.000000000 +0200 ++++ kdebase-workspace-4.3.4/solid/hal/halpower.cpp 2009-12-07 17:28:24.000000000 +0200 +@@ -361,13 +361,21 @@ + Solid::Control::PowerManager::BrightnessControlsList HalPower::brightnessControlsAvailable() + { + Solid::Control::PowerManager::BrightnessControlsList deviceList; +- foreach(const QString &name, m_halManager.call("FindDeviceByCapability", "laptop_panel").arguments().at(0).toStringList()) ++ QDBusReply<QStringList> reply = m_halManager.call("FindDeviceByCapability", "laptop_panel"); ++ if (reply.isValid()) + { +- deviceList.insert(name, Solid::Control::PowerManager::Screen); ++ foreach(const QString &name, reply.value()) ++ { ++ deviceList.insert(name, Solid::Control::PowerManager::Screen); ++ } + } +- foreach(const QString &name, m_halManager.call("FindDeviceByCapability", "keyboard_backlight").arguments().at(0).toStringList()) ++ reply = m_halManager.call("FindDeviceByCapability", "keyboard_backlight"); ++ if (reply.isValid()) + { +- deviceList.insert(name, Solid::Control::PowerManager::Keyboard); ++ foreach(const QString &name, reply.value()) ++ { ++ deviceList.insert(name, Solid::Control::PowerManager::Keyboard); ++ } + } + return deviceList; + } +@@ -375,42 +383,53 @@ + float HalPower::brightness(const QString &device) + { + float brightness; +- if(m_halManager.call("FindDeviceByCapability", "laptop_panel").arguments().at(0).toStringList().contains(device)) ++ QDBusReply<QStringList> reply = m_halManager.call("FindDeviceByCapability", "laptop_panel"); ++ if(reply.isValid() && reply.value().contains(device)) + { + QDBusInterface deviceInterface("org.freedesktop.Hal", device, "org.freedesktop.Hal.Device.LaptopPanel", QDBusConnection::systemBus()); +- brightness = deviceInterface.call("GetBrightness").arguments().at(0).toDouble(); +- if(deviceInterface.lastError().isValid()) ++ QDBusReply<double> brightnessReply = deviceInterface.call("GetBrightness"); ++ if(!brightnessReply.isValid()) + { +- return 0; ++ return 0.0; + } +- else ++ brightness = brightnessReply; ++ ++ QDBusInterface propertyInterface("org.freedesktop.Hal", device, "org.freedesktop.Hal.Device", QDBusConnection::systemBus()); ++ QDBusReply<int> levelsReply = propertyInterface.call("GetProperty", "laptop_panel.num_levels"); ++ if (levelsReply.isValid()) + { +- QDBusInterface propertyInterface("org.freedesktop.Hal", device, "org.freedesktop.Hal.Device", QDBusConnection::systemBus()); +- int levels = propertyInterface.call("GetProperty", "laptop_panel.num_levels").arguments().at(0).toInt(); ++ int levels = levelsReply; + return (float)(100*(brightness/(levels-1))); + } + } +- if(m_halManager.call("FindDeviceByCapability", "keyboard_backlight").arguments().at(0).toStringList().contains(device)) ++ ++ reply = m_halManager.call("FindDeviceByCapability", "keyboard_backlight"); ++ if(reply.isValid() && reply.value().contains(device)) + { + QDBusInterface deviceInterface("org.freedesktop.Hal", device, "org.freedesktop.Hal.Device.KeyboardBacklight", QDBusConnection::systemBus()); //TODO - I do not have a backlight enabled keyboard, so I'm guessing a bit here. Could someone please check this. +- brightness = deviceInterface.call("GetBrightness").arguments().at(0).toDouble(); +- if(deviceInterface.lastError().isValid()) ++ ++ QDBusReply<double> brightnessReply = deviceInterface.call("GetBrightness"); ++ if(!brightnessReply.isValid()) + { +- return 0; ++ return 0.0; + } +- else ++ brightness = brightnessReply; ++ ++ QDBusInterface propertyInterface("org.freedesktop.Hal", device, "org.freedesktop.Hal.Device", QDBusConnection::systemBus()); ++ QDBusReply<int> levelsReply = propertyInterface.call("GetProperty", "keyboard_backlight.num_levels"); ++ if (levelsReply.isValid()) + { +- QDBusInterface propertyInterface("org.freedesktop.Hal", device, "org.freedesktop.Hal.Device", QDBusConnection::systemBus()); +- int levels = propertyInterface.call("GetProperty", "keyboard_backlight.num_levels").arguments().at(0).toInt(); ++ int levels = levelsReply; + return (float)(100*(brightness/(levels-1))); + } + } +- return 0; ++ return 0.0; + } + + bool HalPower::setBrightness(float brightness, const QString &device) + { +- if(m_halManager.call("FindDeviceByCapability", "laptop_panel").arguments().at(0).toStringList().contains(device)) ++ QDBusReply<QStringList> reply = m_halManager.call("FindDeviceByCapability", "laptop_panel"); ++ if(reply.isValid() && reply.value().contains(device)) + { + QDBusInterface propertyInterface("org.freedesktop.Hal", device, "org.freedesktop.Hal.Device", QDBusConnection::systemBus()); + int levels = propertyInterface.call("GetProperty", "laptop_panel.num_levels").arguments().at(0).toInt(); +@@ -422,7 +441,9 @@ + return true; + } + } +- if(m_halManager.call("FindDeviceByCapability", "keyboard_backlight").arguments().at(0).toStringList().contains(device)) ++ ++ reply = m_halManager.call("FindDeviceByCapability", "keyboard_backlight"); ++ if(reply.isValid() && reply.value().contains(device)) + { + QDBusInterface propertyInterface("org.freedesktop.Hal", device, "org.freedesktop.Hal.Device", QDBusConnection::systemBus()); + int levels = propertyInterface.call("GetProperty", "keyboard_backlight.num_levels").arguments().at(0).toInt(); diff --git a/kde-base/solid/solid-4.3.4-r1.ebuild b/kde-base/solid/solid-4.3.4-r1.ebuild new file mode 100644 index 000000000000..df7021c15280 --- /dev/null +++ b/kde-base/solid/solid-4.3.4-r1.ebuild @@ -0,0 +1,40 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/kde-base/solid/solid-4.3.4-r1.ebuild,v 1.1 2009/12/07 15:34:47 ssuominen Exp $ + +EAPI="2" + +KMNAME="kdebase-workspace" +CPPUNIT_REQUIRED="test" +inherit kde4-meta + +DESCRIPTION="Solid: the KDE hardware library" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86" +IUSE="bluetooth debug networkmanager wicd" + +# solid/CMakeLists.txt has an add_subdirectory statement that depends on +# networkmanager-0.7, referring to a non-existant directory, restricted to =0.6* +# for now. +DEPEND=" + >=sys-apps/hal-0.5.9 + bluetooth? ( net-wireless/bluez ) + networkmanager? ( >=net-misc/networkmanager-0.7 ) + wicd? ( net-misc/wicd ) +" +RDEPEND="${DEPEND}" + +KMEXTRA=" + libs/solid/ +" + +PATCHES=( "${FILESDIR}/${P}-hal.patch" ) + +src_configure() { + mycmakeargs="${mycmakeargs} + $(cmake-utils_use_with bluetooth BlueZ) + $(cmake-utils_use_with networkmanager NetworkManager) + $(cmake-utils_use_build wicd) + " + + kde4-meta_src_configure +} |