do not show edit bookmarks action if keditbookmarks is not installed
ClosedPublic

Authored by sitter on Nov 15 2017, 7:42 AM.

Details

Summary

keditbookmarks lives in applications, making it very likely that it is
not installed. this does already raise an error window explaining that
the binary is not installed, unfortunately that is fairly poor user
experience. instead do not show the edit action if we have no editor
installed.

this is a bit unfortunate design-wise KBookmarkOwner is meant to control
if the edit action is shown, it does however encourage deriving from it
to control this behavior making it more than likely that devs simply derive
and override enableOption always returning true to enable all features
(while technically unnecessary). to deal with this we make the executable
lookup in the menu implementation, in addition to checking enableOption.
effectively we now have "does the owner want us to show the edit option,
and if so can we even edit?"

Test Plan
  • uninstall keditbookmarks
  • konsole has no edit entry
  • install again
  • konsole has edit entry

Diff Detail

Repository
R294 KBookmarks
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
sitter created this revision.Nov 15 2017, 7:42 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 15 2017, 7:42 AM
apol added a subscriber: apol.Nov 15 2017, 11:18 AM

LGTM

src/kbookmarkmenu_p.h
42

Why not in the cpp file?

sitter added inline comments.Nov 15 2017, 11:22 AM
src/kbookmarkmenu_p.h
42

It's used in 2 difference cpps.

apol accepted this revision.Nov 22 2017, 12:32 PM
This revision is now accepted and ready to land.Nov 22 2017, 12:32 PM
This revision was automatically updated to reflect the committed changes.