summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--settings-backend/kconfig_backend.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/settings-backend/kconfig_backend.cpp b/settings-backend/kconfig_backend.cpp
index c36f82d..f58ea8e 100644
--- a/settings-backend/kconfig_backend.cpp
+++ b/settings-backend/kconfig_backend.cpp
@@ -406,6 +406,8 @@ gboolean get_setting_is_read_only(BerylSetting * setting)
GSList * get_existing_profiles(void)
{
+ if (!instance)
+ instance = new KInstance("beryl-kconfig");
QDir dir(KGlobal::dirs()->saveLocation("config", QString::null, false),"berylrc.*");
QStringList files = dir.entryList();
@@ -1170,7 +1172,9 @@ void write_done(BerylSettingsContext * c)
gboolean backend_init (BerylSettingsContext *)
{
- return TRUE;
+ if (!instance)
+ instance = new KInstance("beryl-kconfig");
+ return TRUE;
}
gboolean backend_fini (BerylSettingsContext *)
@@ -1188,3 +1192,18 @@ gboolean get_supports_integration(void)
return TRUE;
}
+gboolean delete_profile(gchar * profile)
+{
+ QString file(KGlobal::dirs()->saveLocation("config", QString::null, false));
+ file += "berylrc";
+ if (profile && strlen(profile))
+ {
+ file += ".";
+ file += profile;
+ }
+
+ if (QFile::exists(file))
+ return QFile::remove(file);
+
+ return FALSE;
+}