summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <montel@kde.org>2016-09-08 06:17:04 (GMT)
committerMontel Laurent <montel@kde.org>2016-09-08 06:17:04 (GMT)
commit766ae9c5c15e2f695d9fee91ba67a48f2757b18e (patch)
treed455759ae521849ded325c4ffb2ae221d31732a2
parent6210783be8d65b50c032579cd61e03ca60f0feaa (diff)
Add save method
-rw-r--r--src/genericplugins/pluginutil.cpp8
-rw-r--r--src/genericplugins/pluginutil.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/genericplugins/pluginutil.cpp b/src/genericplugins/pluginutil.cpp
index ffe0281..b86cc18 100644
--- a/src/genericplugins/pluginutil.cpp
+++ b/src/genericplugins/pluginutil.cpp
@@ -50,3 +50,11 @@ QPair<QStringList, QStringList> PimCommon::PluginUtil::loadPluginSetting(const Q
pair.second = disabledPlugins;
return pair;
}
+
+void PimCommon::PluginUtil::savePluginSettings(const QString &groupName, const QString &prefixSettingKey, const QStringList &enabledPluginsList, const QStringList &disabledPluginsList)
+{
+ KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("pimpluginsrc"));
+ KConfigGroup grp = config->group(groupName);
+ grp.writeEntry(QStringLiteral("%1Enabled").arg(prefixSettingKey), enabledPluginsList);
+ grp.writeEntry(QStringLiteral("1Disabled").arg(prefixSettingKey), disabledPluginsList);
+}
diff --git a/src/genericplugins/pluginutil.h b/src/genericplugins/pluginutil.h
index 88ede17..c15227d 100644
--- a/src/genericplugins/pluginutil.h
+++ b/src/genericplugins/pluginutil.h
@@ -31,6 +31,7 @@ namespace PluginUtil
{
PIMCOMMON_EXPORT bool isPluginActivated(const QStringList &enabledPluginsList, const QStringList &disabledPluginsList, bool isEnabledByDefault, const QString &pluginId);
PIMCOMMON_EXPORT QPair<QStringList, QStringList> loadPluginSetting(const QString &groupName, const QString &prefixSettingKey);
+PIMCOMMON_EXPORT void savePluginSettings(const QString &groupName, const QString &prefixSettingKey, const QStringList &enabledPluginsList, const QStringList &disabledPluginsList);
}
}