Allow to disable version control plugins. It's too late already for providing a UI (string freeze...) and it should not be necessary to disable a plugin, but in the worst case (e. g. plugin crashes under certain circumstances) it is good to have a non-GUI fallback.

svn path=/trunk/KDE/kdebase/apps/; revision=1061740
This commit is contained in:
Peter Penz 2009-12-12 22:44:05 +00:00
parent df0b75e8c8
commit af7ced9047
4 changed files with 40 additions and 9 deletions

View file

@ -70,7 +70,9 @@ kde4_add_kcfg_files(dolphinprivate_LIB_SRCS
settings/dolphin_directoryviewpropertysettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
settings/dolphin_generalsettings.kcfgc)
settings/dolphin_generalsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
)
kde4_add_library(dolphinprivate SHARED ${dolphinprivate_LIB_SRCS})
@ -264,7 +266,9 @@ kde4_add_kcfg_files(kcm_dolphinviewmodes_PART_SRCS
settings/dolphin_directoryviewpropertysettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
settings/dolphin_generalsettings.kcfgc)
settings/dolphin_generalsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
)
kde4_add_kcfg_files(kcm_dolphinnavigation_PART_SRCS
settings/dolphin_generalsettings.kcfgc)
@ -298,10 +302,16 @@ install(TARGETS kcm_dolphingeneral DESTINATION ${PLUGIN_INSTALL_DIR} )
########### install files ###############
install( FILES dolphin.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES settings/dolphin_directoryviewpropertysettings.kcfg settings/dolphin_generalsettings.kcfg settings/dolphin_columnmodesettings.kcfg settings/dolphin_iconsmodesettings.kcfg settings/dolphin_detailsmodesettings.kcfg DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES dolphinui.rc DESTINATION ${DATA_INSTALL_DIR}/dolphin )
install( FILES search/dolphinsearchcommands.desktop DESTINATION ${DATA_INSTALL_DIR}/dolphin )
install( FILES dolphin.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
install( FILES settings/dolphin_directoryviewpropertysettings.kcfg
settings/dolphin_generalsettings.kcfg
settings/dolphin_columnmodesettings.kcfg
settings/dolphin_iconsmodesettings.kcfg
settings/dolphin_detailsmodesettings.kcfg
settings/dolphin_versioncontrolsettings.kcfg
DESTINATION ${KCFG_INSTALL_DIR} )
install( FILES dolphinui.rc DESTINATION ${DATA_INSTALL_DIR}/dolphin )
install( FILES search/dolphinsearchcommands.desktop DESTINATION ${DATA_INSTALL_DIR}/dolphin )
install( FILES kcm/kcmdolphinviewmodes.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES kcm/kcmdolphinnavigation.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
install( FILES kcm/kcmdolphinservices.desktop DESTINATION ${SERVICES_INSTALL_DIR} )

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd">
<kcfg>
<kcfgfile name="dolphinrc"/>
<group name="VersionControl">
<entry name="disabledPlugins" type="String">
<label>Disabled plugins</label>
<default></default>
</entry>
</group>
</kcfg>

View file

@ -0,0 +1,4 @@
File=dolphin_versioncontrolsettings.kcfg
ClassName=VersionControlSettings
Singleton=true
Mutators=true

View file

@ -20,6 +20,7 @@
#include "versioncontrolobserver.h"
#include <dolphinmodel.h>
#include "dolphin_versioncontrolsettings.h"
#include <kdirlister.h>
#include <klocale.h>
@ -276,11 +277,16 @@ KVersionControlPlugin* VersionControlObserver::searchPlugin(const KUrl& director
if (plugins.isEmpty()) {
// No searching for plugins has been done yet. Query the KServiceTypeTrader for
// all fileview version control plugins and remember them in 'plugins'.
const QString disabledPlugins = VersionControlSettings::disabledPlugins();
const QStringList disabledPluginsList = disabledPlugins.split(',');
const KService::List pluginServices = KServiceTypeTrader::self()->query("FileViewVersionControlPlugin");
for (KService::List::ConstIterator it = pluginServices.constBegin(); it != pluginServices.constEnd(); ++it) {
KVersionControlPlugin* plugin = (*it)->createInstance<KVersionControlPlugin>();
Q_ASSERT(plugin != 0);
plugins.append(plugin);
if (!disabledPluginsList.contains((*it)->name())) {
KVersionControlPlugin* plugin = (*it)->createInstance<KVersionControlPlugin>();
Q_ASSERT(plugin != 0);
plugins.append(plugin);
}
}
if (plugins.isEmpty()) {
pluginsAvailable = false;