Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 212851 Details for
Bug 296544
kde-base/solid patch to fix bug #295600 causes screen brightness to reset to 0
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Corrected previous patch
solid-4.3.4-hal.patch (text/plain), 6.00 KB, created by
Nate Weibley
on 2009-12-13 06:13:01 UTC
(
hide
)
Description:
Corrected previous patch
Filename:
MIME Type:
Creator:
Nate Weibley
Created:
2009-12-13 06:13:01 UTC
Size:
6.00 KB
patch
obsolete
>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<int> 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<int> 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();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 296544
:
212849
| 212851 |
212852