Danny Kukawka wrote:

> On Donnerstag, 5. Juli 2007, Xavier wrote:
>> Hi,
>>
>> I have the following bug:
>> kpowersave crashes when I open the configure dialog box.
>>
>> I'm using kpowersave 0.7.2.
>>
>> I looked at the code and I have the following clue.
>>
>> In file configuredialog.cpp:75
>>
>> // check if brightness is supported
>> if((brightnessLevels = (hwinfo->getMaxBrightnessLevel()-1)) >= 0) {
>>   brightness_supported = true;
>>   brightness_last = hwinfo->getCurrentBrightnessLevel();
>> }
>>
>> In my case hwinfo->getMaxBrightnessLevel() returns 1 and then
>> brightness_supported is set to true and brightnessLevels to 0.
> 
> Uh ... what kind of machine is this? Could you attach the output of lshal?
> I have never seen a machine where HAL return only _one_ level for
> brightness.
> 

The machine is a dell latitude d620.

Here is the output of lshal (only the part about laptop_panel, tell me if
you want more):

udi = '/org/freedesktop/Hal/devices/dell_lcd_panel'
  info.addons = {'hald-addon-dell-backlight'} (string list)
  info.bus = 'unknown'  (string)
  info.capabilities = {'laptop_panel'} (string list)
  info.category = 'laptop_panel'  (string)
  info.interfaces = {'org.freedesktop.Hal.Device.LaptopPanel'} (string list)
  info.parent = '/org/freedesktop/Hal/devices/computer'  (string)
  info.product = 'Dell Laptop Panel'  (string)
  info.subsystem = 'unknown'  (string)
  info.udi = '/org/freedesktop/Hal/devices/dell_lcd_panel'  (string)
  laptop_panel.access_method = 'custom'  (string)
  laptop_panel.brightness_in_hardware = false  (bool)
  laptop_panel.num_levels = 1  (0x1)  (int)
  org.freedesktop.Hal.Device.LaptopPanel.method_argnames =
{'brightness_value', ''} (string list)
  org.freedesktop.Hal.Device.LaptopPanel.method_execpaths =
{'hal-system-lcd-set-brightness', 'hal-system-lcd-get-brightness'} (string
list)
  org.freedesktop.Hal.Device.LaptopPanel.method_names =
{'SetBrightness', 'GetBrightness'} (string list)
  org.freedesktop.Hal.Device.LaptopPanel.method_signatures = {'i', ''}
(string list)


Sometimes ago, I remember that backlight wasn't supported but it didn't make
it crash. I think it crashes since I updated hal and it added support for
my laptop backlight (maybe since 0.5.9.1).



>> Then, at line 497 of the same file:
>> brightnessSlider->setLineStep(100/brightnessLevels);
>>
>> brightnessLevels' value is still 0 and it crashes (division by 0).
>>
>> I don't really know how to fix it to get the correct behaviour but I
>> think you should know.
> 
> Yes, I can ;-)

Thanks,


Xavier



_______________________________________________
powersave-devel mailing list
[email protected]
http://forge.novell.com/mailman/listinfo/powersave-devel

Reply via email to