KDE/kdelibs/kdeui/xmlgui

Friedrich W. H. Kossebau kossebau at kde.org
Thu Jan 1 23:29:21 GMT 2009


Am Mittwoch, 31. Dezember 2008, um 12:53 Uhr, schrieb Urs Wolfer:
> On Wednesday 31 December 2008 12:03:53 Friedrich W. H. Kossebau wrote:
> > Am Dienstag, 30. Dezember 2008, um 22:41 Uhr, schrieb Urs Wolfer:
> > > SVN commit 903567 by uwolfer:
> This issue has already been discussed on k-d, see "KBookmarkManager vs. XML
> GUI". Nobody came up with a solution. So I debugged for quite some time
> this issue and found this as the only workable solution. I tested it with
> all appps I know that use bookmarking features (but I forgot Okteta) and it
> looked like it does not break anything. I also suggested the fix on the
> b.k.o report [1] before committing for approval.

Searched k-c-d, but not k-d, alright :) 

> This regression has been introduced by SVN commit 837041 by zander which
> fixed some issues in KBookmarkManager that shortcuts were not changable
> because actions were added to the actionscollection after showing up in the
> GUI. The commit basically looks okay to me and makes sense.
>
> Anyway, I wonder why it worked before.. ui_standards.rc use "bookmark_add"
> and KBookmarkmanager adds the action "add_bookmark"... But that's another
> topic.
>
> The fix for Okteta would be quite simple:
>
> -  <Menu name="bookmarks">
> +  <Menu name="bookmarks"><text>&Bookmarks</text>
>
> but I feel not like deciding if this is acceptable.

It would work(tm), but defeats the purpose of standardizing menus with XMLGUI, 
doesn't it? If you look at that change you see that it reduces the set of 
standardized entries. For sure, the bookmarks menu is a complicated beast and 
perhaps escapes standardizing a little. But please let's try as hard as 
possible.

> I hope sombody comes up with a better fix. Otherwise it's to decide what to
> do:
> #1: revert both KBookmarkmanager and my ui_standards.rc commit and thus
> break shortcut configuration for all bookmark feautures in every app again.
>
> #2: test this change with all known apps which use bookmark feature. I have
> done that already, but most probably forgot some. Fix it if a app would be
> broken (Okteta is the only known so far).
>
> What is your proposal?

To take half an hour, then one more, and another one, and find the source of 
the problem, with another pair of eyes ;)

KBookmarkMenu calls KActionCollection to create a standard action, but with 
own identifier, e.g "add_bookmark" instead of "bookmark_add". 
KActionCollection now calls KStandardAction::create(), before it sets the 
given identifier and adds the created action to its list. But KStandardAction 
now perhaps tries to be too smart: After creating the standard action, 
including the default identifier, it sees if the parent is a 
KActionCollection and then adds it to it, with the default identifier. Which 
in the case of bookmark_add and bookmark_edit triggers the creation of the 
default Bookmarks menu. Fail.

Patch? None so far. Bedtime for me now.

Cheers
Friedrich
-- 
Okteta - KDE 4 Hex Editor - http://utils.kde.org/projects/okteta




More information about the kde-core-devel mailing list