Patch to add key shourtcut names to action's tooltips
Vladimir Prus
ghost at cs.msu.su
Tue May 23 06:54:51 UTC 2006
On Wednesday 10 May 2006 19:24, Lyubitskiy Alex wrote:
> Hmm, it's stange because I attached patch file to the letter.
> Anyway, here is it:
>
> Index: src/mainwindowshare.h
> ===================================================================
> --- src/mainwindowshare.h (revision 539267)
> +++ src/mainwindowshare.h (working copy)
> @@ -36,6 +36,7 @@
>
> void createActions();
> void init();
> + void configureKeyTips();
Alex,
I've was running KDevelop with this patch, and the functionality is fine.
However, I've noted a slight glitch -- whenever I open a new file, the
configureKeyTips is called and processes all KParts, not just the KPart for
the opened file. Moreover, when I switch from open open file to another open
file, configureKeyTips is called *again* for all KParts.
This does not cause much slowdown, but is pretty inelegant. The problem is
that you have call to configureKeyTips in slotGUICreated. Looking at the
code, it appears the slotGUICreated is connected to signal
PartController::activePartChanged (that signal is inherited from
KParts::partManager). So, slotGUICreated is called for each switch of file.
I don't know why slotGUICreated is so confusingly named, but calling
configureKeyTips there does not seem right. Maybe, it's better to call it
from PartController::slotPartAdded?
Also, note that both slotGUICreated and slotPartAdded have KPart* parameter.
It does not seem right to process *all* KParts then. I'd suggest this:
- Create new configureKeyTips(KPart*) method, that configures key tips for
for KPart only.
- Reimplement configureKeyTips() in terms for configureKeyTips(KPart*)
- Call configureKeyTips() when shortcuts are configured by the user.
- Call configureKeyTips(KPart*) from slotPartAdded.
Anybody objects if I commit this patch, as soon as above issues are addressed?
- Volodya
More information about the KDevelop-devel
mailing list