Update KIPI toolbar button after installation of kipi-plugins

Authored by rkflx on May 31 2018, 9:58 AM.

Description

Update KIPI toolbar button after installation of kipi-plugins

Summary:
In case there are no KIPI plugins installed, Gwenview can offer to
Install Plugins. After installation completed, the Plugins
entry in the menubar would update itself, however the KIPI toolbar
button would still show No Plugin found.

By always listening to KIPIInterface::loadingFinished, we are notified
through mPluginLoadTimer when the menu needs to be updated in reaction
to the plugin installation finishing.

To avoid showing Install Plugins as a Last Used Plugin in
case the installation was aborted, that section is only added when it
makes sense, i.e. when there is actually more than one plugin to show.

While mExportActionList does not contain Install Plugins anymore
after installation completed successfully, it is still contained in
mDefaultAction, which cannot be prevented easily due to not having
access to KIPIInterfacePrivate::mInstallPluginAction. Therefore we
only ever add actions from mExportActionList, which is the right thing
to do in any case.

Test Plan:
Install Discover, remove kipi-plugins, open Gwenview and
click on PluginsInstall Plugins. Keep Gwenview open while
installing kipi-plugins and observe both the menu entry and the
toolbar button populating themselves after installation completed.

Restarting Gwenview afterwards should populate the toolbar button like
normal.

Reviewers: Gwenview, faridb

Reviewed By: faridb

Differential Revision: https://phabricator.kde.org/D13252