[kdevplatform] fix plugins loading
ClosedPublic

Authored by kfunk on Aug 29 2016, 4:47 AM.

Details

Summary

Old code prevents loading of non-"EnabledByDefault" plugins, even if are was checked by user for loading. The affected plugin - kdevmanpage from kdevelop, now it successfully loads if selected by user.

Diff Detail

Repository
R33 KDevPlatform
Branch
5.0
Lint
No Linters Available
Unit
No Unit Test Coverage
antonanikin updated this revision to Diff 6342.Aug 29 2016, 4:47 AM
antonanikin retitled this revision from to [kdevplatform] fix plugins loading.
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
antonanikin added reviewers: kfunk, KDevelop.
antonanikin set the repository for this revision to R33 KDevPlatform.
antonanikin added a subscriber: kdevelop-devel.
kfunk edited edge metadata.Aug 29 2016, 8:11 PM

Hmm, this appears to be the wrong fix, no?

The *EnabledByDefault* property needs to be read somewhere.

What about:

if (!isUserSelectable)
  return true;
if (userEnabled) // the code from below
  return true;
if (!isGlobalPlugin)
  return enabledByDefault.isNull() || enabledByDefault.toBool();

Makes sense? Maybe I'm missing something...

kfunk requested changes to this revision.Aug 29 2016, 8:11 PM
kfunk edited edge metadata.
This revision now requires changes to proceed.Aug 29 2016, 8:11 PM

The *EnabledByDefault* property needs to be read somewhere.

Hi, Kevin!

https://techbase.kde.org/Development/Tutorials/Kate/KTextEditor_Plugins says:

X-KDE-PluginInfo-EnabledByDefault: whether the plugin is enabled by default. Applied when clicking on "Defaults" button on the plugin selector.

I grep sources of kdevplatform and kdevelop and found that all plugins are "EnabledByDefault" except KDevManPage. It seems that this setting is not used anywhere except in removed code (I can't find something other). I think that we сan safely remove this code without negative consequences, since EnabledByDefault field is only used for setting the initial value of appropriate plugin's property.

mwolff accepted this revision.Sep 5 2016, 12:19 PM
mwolff added a reviewer: mwolff.
mwolff added a subscriber: mwolff.

yeah seems like enabledbydefault is really dead so getting rid of this seems to be a good idea

kfunk commandeered this revision.Sep 6 2016, 1:49 PM
kfunk edited reviewers, added: antonanikin; removed: kfunk.
This revision is now accepted and ready to land.Sep 6 2016, 1:49 PM
kfunk updated this revision to Diff 6483.Sep 6 2016, 1:53 PM
kfunk edited edge metadata.

Upload my version of a patch

kfunk added a comment.Sep 6 2016, 2:20 PM

Note: Please review the new patch.

mwolff added a comment.Sep 6 2016, 7:59 PM

still lgtm, one minor style issue only

shell/plugincontroller.cpp
248

please introduce a temporary for the default plugins map

kfunk closed this revision.Sep 7 2016, 8:25 AM

Pushed.