[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdebase/workspace/kcontrol/launch
From:       André_Wöbbeking <Woebbeking () kde ! org>
Date:       2008-11-19 21:59:32
Message-ID: 200811192259.32707.Woebbeking () kde ! org
[Download RAW message or body]

On Wednesday 19 November 2008, Konstantinos Smanis wrote:
> SVN commit 886636 by ksmanis:
>
> BUG: 161960
>
> Patch which allows the kcmlaunch KCModule to correctly show the
> stored config, instead of always enabling some booleans.
>
> The readEntry function of KConfigGroup should still be fixed. It
> seems to malfunction with bitwise operators.
>
> Kudos to tsdgeos (Albert Astals Cid) for preventing me from nuking
> the original code style.
>
> ---Woohoo! My first bugfix-commit. One step closer to conquering the
> world. (I hope the sysadmins don't delete my account for this
> comment..)
>
>
>
>  M  +6 -6      kcmlaunch.cpp
>
>
> --- trunk/KDE/kdebase/workspace/kcontrol/launch/kcmlaunch.cpp
> #886635:886636 @@ -164,10 +164,10 @@
>    KConfigGroup c = conf.group("FeedbackStyle");
>
>    bool busyCursor =
> -    c.readEntry("BusyCursor", (Default & BusyCursor));
> +    c.readEntry("BusyCursor", (bool)(Default & BusyCursor));
>
>    bool taskbarButton =
> -    c.readEntry("TaskbarButton", (Default & TaskbarButton));
> +    c.readEntry("TaskbarButton", (bool)(Default & TaskbarButton));

Please use static_cast instead of C-casts. They are safer and easier to 
find.

>    cb_taskbarButton->setChecked(taskbarButton);
>
> @@ -226,13 +226,13 @@
>  LaunchConfig::defaults()
>  {
>    cb_busyCursor->setCurrentIndex(2);
> -  cb_taskbarButton->setChecked(Default & TaskbarButton);
> +  cb_taskbarButton->setChecked((bool)Default & TaskbarButton);

This is
1) superfluous, as Default & TaskbarButton results in an int which is 
implicitly casted to a bool
2) maybe even wrong (depends on the precedence of the C-cast)
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic