[PATCH] misbehaving of KToggleActions in exclusiveGroup

David Faure faure at kde.org
Tue Sep 27 13:25:00 BST 2005


On Tuesday 27 September 2005 14:16, Tobias Koenig wrote:
> Hi,
> 
> when you use several KToggleActions in exclusiveGroup mode and plug
> them as KActionList into a menubar the following bug appears:
> 
> 1) Select a non-selected item -> it's checked and all other items of the
>    group become unchecked.
> 
> 2) Select a selected item -> _all_ items (also the selected) becomes
>    unchecked...
> 
> The second shouldn't happen, so the attached patch avoids the toggle
> when the action is already checked and in a exclusive group.

We have a workaround in e.g. kword for this problem, so I agree that there is a problem.
I also checked, and the workaround (cf KWView::viewTextMode()) won't break things
if the fix is applied.

However the reason I didn't fix kdelibs for this back then, was that I thought
there might be a case where applications might want "0 or 1 actions among this group are selected"
instead of what you want (and kword wants), which is "always exactly 1 action among this group is selected".
But since then I don't remember seeing such an application. So if nobody objects
with a concrete case where an app would want the "0 or 1" behavior, I don't object either;
it's certainly confusing for the common "always 1" case.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).





More information about the kde-core-devel mailing list