! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
wrong type for brightness-level-on-{ac,battery}
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description Yves-Alexis Perez editbugs 2011-07-07 10:12:45 CEST
Hey,

it seems that the brightness-level-on-{ac,battery} properties are stored as int and loaded as uint in settings/xfpm-settings.c


	val = xfconf_channel_get_uint (channel, PROPERTIES_PREFIX BRIGHTNESS_LEVEL_ON_AC, 80);


    if (!xfconf_channel_set_int (channel, PROPERTIES_PREFIX BRIGHTNESS_LEVEL_ON_AC, val) )
    {
	g_critical ("Unable to set value %d for property %s\n", val, BRIGHTNESS_LEVEL_ON_AC);
    }

Right now, when the property are changed, they are correctly saved in xfconf, but the xfconf_channel_get_uint() then fails and always return the default value (so 80% for AC and 20% for battery).

Using xfconf_channel_get_int() instead fixes the problem, though it might be more consistent to use an uint since brightness can't be negative (but that means changing more stuff as it seems that not only the set()s are int.
Comment 1 Mark Trompell 2011-08-31 13:19:05 CEST
Created attachment 3840 
uses uint for brightness everywhere
Comment 2 Mark Trompell 2011-08-31 13:37:12 CEST
Created attachment 3841 
Missed some places
Comment 3 Mark Trompell 2011-08-31 13:39:02 CEST
Created attachment 3842 
accidently attached the old patch twice
Comment 4 Lionel Le Folgoc 2012-02-09 21:24:12 CET
*** Bug 8017 has been marked as a duplicate of this bug. ***
Comment 5 Nick Schermer editbugs 2012-04-13 20:53:51 CEST
Applied in 6c96bfa.

Bug #7791

Reported by:
Yves-Alexis Perez
Reported on: 2011-07-07
Last modified on: 2012-04-13
Duplicates (1):
  • 8017 value saved in power manager GUI isn't loaded when opening again

People

Assignee:
Ali Abdallah
CC List:
2 users

Version

Version:
1.0.10

Attachments

uses uint for brightness everywhere (1.85 KB, patch)
2011-08-31 13:19 CEST , Mark Trompell
no flags
Missed some places (2.40 KB, patch)
2011-08-31 13:37 CEST , Mark Trompell
no flags
accidently attached the old patch twice (2.40 KB, patch)
2011-08-31 13:39 CEST , Mark Trompell
mark : review? ( nick )

Additional information