KMenu aboutToShowContextMenu KF5 porting options: None. Do we care?

Albert Astals Cid aacid at kde.org
Sun Jan 31 23:43:27 UTC 2016


In the kdelibs4 world one could connect to KMenu aboutToShowContextMenu signal 
to add more entries to the submenu that appears when right clicking on a menu 
entry.

Nowadays KMenu is gone in apps that do not use kdelibs4support so we can't use 
that.

We still have a default menu that appears when right clicking on a menu entry 
that shows configure shortcuts and add to menu bar options, but that is hidden 
deep in kmenumenuhandler_p.cpp in kxmlgui and exporting that to users is 
probably not going to be trivial (or I couldn't find one in 30 min).

In Okular we used this signal to add the "Rename bookmark" to existing 
bookamrks of the given file, see http://i.imgur.com/UkUVWZx.png

Looking at lxr, Okular seems to be the only one using this feature.

Talking with Aleix yesterday he was arguing that is kind of a hidden feature 
(though there's bug reports to make it do more things) and that it would be 
probably be easier to just drop it in the KF5 port than trying to expose this 
feature again.

I'm asking for more opinions on whether it makes sense for us to think of an 
API to make the context menu on menu entries extensible or we think it's 
better to not have it and I just drop the feature.

Cheers,
  Albert


More information about the Kde-frameworks-devel mailing list