Remove unused vcsannotate_current_document action
AbandonedPublic

Authored by kossebau on Jul 22 2017, 6:50 PM.

Details

Reviewers
brauch
apol
Group Reviewers
KDevelop
Summary

Action was added in 58b72a83f795ab2cd2dc2e4dba1a9d84a777a064
but the action "vcsannotate_current_document" seems never
actually pulled from the actioncollection.
Thus removing as dead code.

Diff Detail

Repository
R33 KDevPlatform
Branch
removedeadannotationaction
Lint
No Linters Available
Unit
No Unit Test Coverage
kossebau created this revision.Jul 22 2017, 6:50 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptJul 22 2017, 6:50 PM
brauch edited edge metadata.Jul 22 2017, 9:21 PM

Huh, does right-click -> git -> show annotation still work after that? If yes, there needs to be a copy of this code somewhere.

Huh, does right-click -> git -> show annotation still work after that? If yes, there needs to be a copy of this code somewhere.

Yes, it does still work. Because the actions in the context menu are added via the IPlugin::contextMenuExtension(...) override, which e.g. for git is in DistributedVersionControlPlugin::contextMenuExtension(...). See also D6838 which fixes somet things in that.

See also D6838 which fixes somet things in that.

Ah, ignore me on that detail, only indirectly now. Still had initial version in mind which also tpuched DistributedVersionControlPlugin::contextMenuExtension(...).

Hmm, I'm still confused why this code was there then. Looking at git history, it was also changed several times, fixing issues. Does invoking the action via its shortcut still work?

Hmm, I'm still confused why this code was there then. Looking at git history, it was also changed several times, fixing issues.

Yes, quite mysterious :) Perhaps the action id "vcsannotate_current_document" had been added to some personal XMLGUI rc files only? Because from how I understand this code, the action is only added to the actioncollection of the document controller, so to be appear in the UI it needs to be referrenced from somewhere, either manually by code getting the action by id and putting it somewhere, or by having the id listed in some rc file. But I could not find anything in history (or even in the default ui_standards.rc.

Does invoking the action via its shortcut still work?

Question is: which shortcut? There is none defined in the code, both in the initial and the other versions I saw in history?

Having a shortcut would be nice though, agreed. Both for showing and hiding the annotation border even. Which shortcut keys were you thinking off?

Though ideally this action & shortcut would be provided and handled by the vcs plugins themselves . So to restore any shortcut functionality you remember, I would be up to write a patch to allow
vcs plugins to hook up such action with shortcut to the main menu, with bonus points also for making it a toggle action depending on the status, independent of being involed by context menu (provided completely by plugins) or main menu.

But in any case, the code as removed in this patch currently is de-funct code, unless I really missed something.
Also slightly hacky how it uses a full VcsPluginHelper instance. So instead of investing into restoring any functionality this code here should have provided, I am rather desperate to rewrite some things in general, so document controller does not need to know about vcs, and vcs plugins properly support multiple views on the same document with/without annotation border. And then with that experience hopefully also try to work on finally getting the annotation border to update on changes. When fixing things for D6838 I already collected some ideas...

You can configure one in either the shortcut dialog or by right-clicking the menu entry, I use Meta+A ...
I agree with your thoughts in general, I just want to avoid breaking things and I'm really at loss about what this code is doing there ;)

kossebau abandoned this revision.EditedJul 23 2017, 1:16 PM

You can configure one in either the shortcut dialog or by right-clicking the menu entry, I use Meta+A ...
I agree with your thoughts in general, I just want to avoid breaking things and I'm really at loss about what this code is doing there ;)

Ah, okay, so it's exposed in the shortcut editor, to those who know. Then yes, removing this code will remove that feature. Okay, so would need replacement code first, discarding this patch then.