D8492: Make SourceFormatter plugins enablable, hide actions with no plugins

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Thu Oct 26 11:16:52 UTC 2017


kossebau created this revision.
kossebau added a reviewer: KDevelop.
Restricted Application added a subscriber: kdevelop-devel.

REVISION SUMMARY
  Source formatting is a feature seemingly only used by some.
  So it makes sense to allow disabling this feature, for some minimal smaller
  runtime footprint and less unused clutter in the UI (like menu actions or
  settings).
  
  This patch achieves this to a good degree:
  
  - makes the plugins astyle & customscript normal global plugins which can be enabled/disabled by the user
  - removes the SourceFormatterController actions from the menus when there are no formatters available
  - shows no source formatting settings page in the project settings when there are no formatters available
  
  Not yet done is to hide the source formatting settings page from the
  application settings dialog in case no formatters are available. That might
  need some more custom logic all over the shell code, which is not so nice.
  Instead the option should be investigated to make the source formatting
  controller a normal plugin with a suited interface, which then can be
  queried by other code needing that service.

TEST PLAN
  See plugins astyle & customscript turn up in plugin selection settings.
  Disable and enable both and see how actions in the main Edit menu and the
  context menu on file items are present or not present, as well as the
  formatting settings page in the project settings dialog being shown or not.
  
  See also the formatting settings pages for projects and the global one only
  offering the formatters of the enabled plugins.

REPOSITORY
  R32 KDevelop

BRANCH
  makeFormatterPluginsDisableable

REVISION DETAIL
  https://phabricator.kde.org/D8492

AFFECTED FILES
  kdevplatform/shell/mainwindow.cpp
  kdevplatform/shell/mainwindow_p.cpp
  kdevplatform/shell/mainwindow_p.h
  kdevplatform/shell/sourceformattercontroller.cpp
  kdevplatform/shell/sourceformattercontroller.h
  kdevplatform/shell/sourceformatterselectionedit.cpp
  kdevplatform/shell/sourceformatterselectionedit.h
  plugins/astyle/kdevastyle.json
  plugins/customscript/kdevcustomscript.json
  plugins/sourceformatter/sourceformatterplugin.cpp

To: kossebau, #kdevelop
Cc: kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20171026/cdc1716c/attachment.html>


More information about the KDevelop-devel mailing list