[Bug] Accels in KActionMenus aren't enabled by KParts::MainWindow::createUI()

Ingo Klöcker kloecker at kde.org
Thu Feb 12 01:26:59 GMT 2004


On Tuesday 10 February 2004 12:53, David Faure wrote:
> On Saturday 31 January 2004 15:00, Ingo Klöcker wrote:
> > Hi,
> >
> > see http://bugs.kde.org/show_bug.cgi?id=70459 for a real world
> > example. Additionally the attached patch (applied to
> > kdelibs/kparts/tests) demonstrates the bug. As long as part 2
> > hasn't been activated the shortcut for "Part 1's Menu->Blah" (which
> > is 'a') and the shortcut for "Part 1's Menu->Foo->Bar" (which is
> > 'f') both work. Now activate part 2 and then reactivate part 1. You
> > can now verify that 'a' is still working but that 'f' doesn't work
> > anymore.
>
> I see the problem.
> With a normal KAction, plug() is called again when reactivating the
> part.
>
> But with a KActionMenu, the action is plugged into the popup-menu
> only once, after that it's the KActionMenu itself that's
> plugged/unplugged, so nothing is calling plugShortcut() for the
> actions in the KActionMenu.
>
> The problem is that KActionMenu has no idea which actions are plugged
> into it, it simply offers a QPopupMenu and lets them plug into it (I
> see a big design problem here, but OTOH I'm not sure how to fix it
> even in kde4).
>
> So I see three solutions (rather, three ways to go from there, no
> real solution yet) :
>
> * not using KActionMenu (but explicitly listing the actions in a
> submenu in the XMLGUI file. This uses a KActionMenu internally IIRC,
> but the actions will be plugged/unplugged from it, so things will
> work as expected).

FYI: That's what I'm going to do to fix the Forward-not-working problem 
in Kontact.

Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040212/c3361c8a/attachment.sig>


More information about the kde-core-devel mailing list