summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoronestone <onestone>2006-12-07 12:40:32 +0000
committeronestone <onestone>2006-12-07 12:40:32 +0000
commit25c743e7bb0aeb926135035126f9692befe9dfc9 (patch)
treeb30eee3075155774b85ff5375d4a4842e216addf
parent68f152c393490ddf46de7d363d0d5402aea49e26 (diff)
downloadaquamarine-25c743e7bb0aeb926135035126f9692befe9dfc9.tar.gz
aquamarine-25c743e7bb0aeb926135035126f9692befe9dfc9.tar.bz2
kconfig-backend: use new libberylsettings options
-rw-r--r--settings-backend/kconfig_backend.cpp33
1 files changed, 27 insertions, 6 deletions
diff --git a/settings-backend/kconfig_backend.cpp b/settings-backend/kconfig_backend.cpp
index ad9ef87..0875372 100644
--- a/settings-backend/kconfig_backend.cpp
+++ b/settings-backend/kconfig_backend.cpp
@@ -270,16 +270,19 @@ static void readIntegratedOption(ConfigFiles *cFiles, BerylSetting * setting)
case OptionSpecial:
if (specialOptions[option].berylName == "command_screenshot")
{
+ setting->read_only = TRUE;
setting->value.value.as_string =
g_strdup("ksnapshot");
}
if (specialOptions[option].berylName == "command_window_screenshot")
{
+ setting->read_only = TRUE;
setting->value.value.as_string =
g_strdup("ksnapshot -c");
}
if (specialOptions[option].berylName == "command11")
{
+ setting->read_only = TRUE;
setting->value.value.as_string =
g_strdup("xkill");
}
@@ -288,6 +291,7 @@ static void readIntegratedOption(ConfigFiles *cFiles, BerylSetting * setting)
|| specialOptions[option].berylName == "maximize_window_horizontally"
|| specialOptions[option].berylName == "maximize_window_vertically")
{
+ setting->read_only = TRUE;
int val = 0;
beryl_setting_value_set_keysym(&setting->value,&val);
beryl_setting_value_set_keymods(&setting->value,&val);
@@ -346,15 +350,20 @@ void read_setting(BerylSettingsContext * c, BerylSetting * setting)
QString key(setting->name);
QString group(setting->parent->name);
if (setting->is_screen)
- group += "_screen0";
+ group += "_screen";
cfg->setGroup(group);
- if (isIntegratedOption(setting))
+ setting->de_integrated = FALSE;
+ setting->read_only = FALSE;
+
+ if (c->de_integration && isIntegratedOption(setting))
{
+ setting->de_integrated = TRUE;
readIntegratedOption(cFiles, setting);
return;
}
+
if (setting->type != BERYL_SETTING_TYPE_BINDING && !cfg->hasKey(key))
return;
@@ -833,10 +842,10 @@ void write_setting(BerylSettingsContext * c, BerylSetting * setting)
QString key(setting->name);
QString group(setting->parent->name);
if (setting->is_screen)
- group += "_screen0";
+ group += "_screen";
cfg->setGroup(group);
- if (isIntegratedOption(setting))
+ if (c->de_integration && isIntegratedOption(setting))
{
writeIntegratedOption(cFiles, setting);
return;
@@ -1008,7 +1017,13 @@ gboolean read_init(BerylSettingsContext * c)
instance = new KInstance("beryl-kconfig");
ConfigFiles *cFiles = new ConfigFiles;
- cFiles->beryl = new KSimpleConfig("berylrc",true);
+ QString configName("berylrc");
+ if (c->profile)
+ {
+ configName += ".";
+ configName += c->profile;
+ }
+ cFiles->beryl = new KSimpleConfig(configName);
cFiles->kwin = new KConfig("kwinrc",true);
cFiles->global = new KConfig("kdeglobals",true);
cFiles->kwin->setGroup("Windows");
@@ -1034,7 +1049,13 @@ gboolean write_init(BerylSettingsContext * c)
instance = new KInstance("beryl-kconfig");
ConfigFiles *cFiles = new ConfigFiles;
- cFiles->beryl = new KSimpleConfig("berylrc");
+ QString configName("berylrc");
+ if (c->profile)
+ {
+ configName += ".";
+ configName += c->profile;
+ }
+ cFiles->beryl = new KSimpleConfig(configName);
cFiles->kwin = new KConfig("kwinrc");
cFiles->global = new KConfig("kdeglobals");
cFiles->kwin->setGroup("Windows");