DevHeads.net

Review Request 110625: Make it possible to disable KAbstractFileItemActionPlugins by default

Review request for kdelibs.

Description
Currently, all KAbstractFileItemActionPlugins which are installed are embedded into file management-related context menus unless the user explicitly disables them in the settings.

This becomes problematic if the plugin's actions() method executes code that is not guaranteed to return very fast - the user will notice that the host application freezes without even knowing that one of the plugins is the culprit.

In a perfect world, all code executed by plugins would be perfect and the problem would not exist at all. Unfortunately, the world is not perfect, and there are plugins which do things that succeed most of the time, but cause trouble sometimes: <a href="https://bugs.kde.org/show_bug.cgi?id=314575" title="https://bugs.kde.org/show_bug.cgi?id=314575">https://bugs.kde.org/show_bug.cgi?id=314575</a>

It seems that what Activities is trying to achieve cannot easily be solved using a safer approach which is equally user-friendly for Activities users. On the other hand, I don't think that people who do not use the plugin at all should suffer from the freezes caused by the plugin, so I thought that we could give developers of plugins which execute some "fragile" code the chance to declare that only users who enable the plugin explicitly in the settings should see the plugin's actions in their context menu.

For further information, please see <a href="https://bugs.kde.org/show_bug.cgi?id=314575" title="https://bugs.kde.org/show_bug.cgi?id=314575">https://bugs.kde.org/show_bug.cgi?id=314575</a>.

Unfortunately, the original author of KAbstractFileItemActionPlugin chose to not add a d-pointer, so I had to use a hack to make it work.

I have patches that make this work:

kactivities (includes another change that fixes a build failure for me): <a href="http://paste.kde.org/749834/" title="http://paste.kde.org/749834/">http://paste.kde.org/749834/</a>
kde-baseapps: <a href="http://paste.kde.org/749846/" title="http://paste.kde.org/749846/">http://paste.kde.org/749846/</a>

Diffs
kio/kio/kabstractfileitemactionplugin.h 6af7396
kio/kio/kabstractfileitemactionplugin.cpp 07f15f6

Diff: <a href="http://git.reviewboard.kde.org/r/110625/diff/" title="http://git.reviewboard.kde.org/r/110625/diff/">http://git.reviewboard.kde.org/r/110625/diff/</a>

Testing
Deleted kservicemenurc -> Activities not shown in Konqueror/Dolphin context menus, and the plugin is shown as disabled in the settings.

Enabled the plugin in the settings dialog of either Konqueror or Dolphin -> plugin is shown, and disabling it in the dialog hides it again.

Thanks,

Frank Reininghaus

Comments

Re: Review Request 110625: Make it possible to disable KAbstract

By Commit Hook at 05/28/2013 - 16:05

(Updated May 28, 2013, 9:05 p.m.)

Status
This change has been marked as submitted.

Review request for kdelibs.

Description
Currently, all KAbstractFileItemActionPlugins which are installed are embedded into file management-related context menus unless the user explicitly disables them in the settings.

This becomes problematic if the plugin's actions() method executes code that is not guaranteed to return very fast - the user will notice that the host application freezes without even knowing that one of the plugins is the culprit.

In a perfect world, all code executed by plugins would be perfect and the problem would not exist at all. Unfortunately, the world is not perfect, and there are plugins which do things that succeed most of the time, but cause trouble sometimes: <a href="https://bugs.kde.org/show_bug.cgi?id=314575" title="https://bugs.kde.org/show_bug.cgi?id=314575">https://bugs.kde.org/show_bug.cgi?id=314575</a>

It seems that what Activities is trying to achieve cannot easily be solved using a safer approach which is equally user-friendly for Activities users. On the other hand, I don't think that people who do not use the plugin at all should suffer from the freezes caused by the plugin, so I thought that we could give developers of plugins which execute some "fragile" code the chance to declare that only users who enable the plugin explicitly in the settings should see the plugin's actions in their context menu.

For further information, please see <a href="https://bugs.kde.org/show_bug.cgi?id=314575" title="https://bugs.kde.org/show_bug.cgi?id=314575">https://bugs.kde.org/show_bug.cgi?id=314575</a>.

Unfortunately, the original author of KAbstractFileItemActionPlugin chose to not add a d-pointer, so I had to use a hack to make it work.

I have patches that make this work:

kactivities (includes another change that fixes a build failure for me): <a href="http://paste.kde.org/749834/" title="http://paste.kde.org/749834/">http://paste.kde.org/749834/</a>
kde-baseapps: <a href="http://paste.kde.org/749846/" title="http://paste.kde.org/749846/">http://paste.kde.org/749846/</a>

Diffs
kio/kio/kabstractfileitemactionplugin.h 6af7396
kio/kio/kabstractfileitemactionplugin.cpp 07f15f6

Diff: <a href="http://git.reviewboard.kde.org/r/110625/diff/" title="http://git.reviewboard.kde.org/r/110625/diff/">http://git.reviewboard.kde.org/r/110625/diff/</a>

Testing
Deleted kservicemenurc -> Activities not shown in Konqueror/Dolphin context menus, and the plugin is shown as disabled in the settings.

Enabled the plugin in the settings dialog of either Konqueror or Dolphin -> plugin is shown, and disabling it in the dialog hides it again.

Thanks,

Frank Reininghaus

Re: Review Request 110625: Make it possible to disable KAbstract

By Commit Hook at 05/28/2013 - 16:05

This review has been submitted with commit b97dad72c39edd27450e999b8042e1d7e85231a3 by Frank Reininghaus to branch master.

- Commit Hook

On May 23, 2013, 8:55 p.m., Frank Reininghaus wrote: