How to make the CTags plugin default disabled for only KDevelop, but not Kate?

Christoph Cullmann christoph at cullmann.io
Thu Jul 11 06:44:56 BST 2019


Hi,

On 2019-07-10 23:03, Friedrich W. H. Kossebau wrote:
> Hi,
> 
> with the Kate Addons plugin CTags having now in its metadata
>     ServiceTypes=KTextEditor/Plugin,KDevelop/Plugin
> this results in this plugin also being loaded by default in KDevelop. 
> For
> everyone, until they explicitly remove it from the enabled plugins.
> 
> Which kind of ruins at least the first time user experience for a user 
> with
> KDevelop on a system which also has Kate installed (which I would 
> expect to
> be lots, if not majority).
> Because KDevelop in theory does not need this plugin due to its own 
> (great)
> code symbol engine. And making this plugin available also for KDevelop 
> was
> only meant to be for a niche of users (or only one?) where KDevelop's 
> own
> engine can not be used for reasons.
> 
> See https://phabricator.kde.org/D16779 for some background.
> 
> So, this plugin should by default be disabled. But only for KDevelop. I
> assume at least Kate wants to have it on by default.
> 
> I am wondering about the best approach.
> 
> There is the KPlugin metadata entry
>     "X-KDE-PluginInfo-EnabledByDefault" (desktop file)
> resp.
>     "{ "KPlugin": {  "EnabledByDefault": true/false } }" (embedded 
> JSON) to
> control this usually. But this entry would be read both by Kate & 
> KDevelop
> (and other potential KTE plugin users).
> 
> The ctags plugin could be caught hard-coded in KDevelop code. IMHO not 
> nice
> (only okay as temporary fix for 5.3.3 release)
> 
> We could add invent a new metadata key "X-KDevelop-PluginInfo-
> EnabledByDefault", have the CTags plugin set that to "false" and extend
> KDevelop's plugin code to also check that.
> 
> Opinions? Better ideas?

actually I think the best approach is to have a whitelist of plugins one 
wants to
load per default.

Kate does that since years and that served well.

e.g. see

https://cgit.kde.org/kate.git/tree/kate/katepluginmanager.cpp

     defaultPlugins.insert(QStringLiteral("cuttlefishplugin")); // this 
comes with package plasma5-sdk but it won't hurt to list it here 
(activate by right click in the text area)
#ifndef WIN32
     defaultPlugins.insert(QStringLiteral("katefilebrowserplugin")); // 
currently works badly on Windows
     defaultPlugins.insert(QStringLiteral("katekonsoleplugin")); // 
currently does not work on Windows at all
#endif
     defaultPlugins.insert(QStringLiteral("katefiletreeplugin"));
     defaultPlugins.insert(QStringLiteral("kateprojectplugin"));
     defaultPlugins.insert(QStringLiteral("katesearchplugin"));
     defaultPlugins.insert(QStringLiteral("tabswitcherplugin"));
     defaultPlugins.insert(QStringLiteral("textfilterplugin"));

(actually I think the cuttlefishplugin is useless for most people and 
shall be removed from the defaults).

This avoids any issues with strange plugins popping up, just because 
they are installed on your system.

Greetings
Christoph

-- 
Ignorance is bliss...
https://cullmann.io | https://kate-editor.org


More information about the KWrite-Devel mailing list