~compiz-team/compiz-compizconfig-gconf/0.9.5

« back to all changes in this revision

Viewing changes to src/gconf.c

  • Committer: Sam Spilsbury
  • Date: 2011-07-29 15:39:16 UTC
  • mfrom: (153.1.3)
  • Revision ID: git-v1:5db1208c8944053ae5a14eaf37cc10a4f203c6c4
Merge in settings upgrade work

Show diffs side-by-side

added added

removed removed

Lines of Context:
443
443
    char         *pluginName;
444
444
    char         *token;
445
445
    int          index;
446
 
    Bool         isScreen;
447
446
    unsigned int screenNum;
448
447
    CCSPlugin    *plugin;
449
448
    CCSSetting   *setting;
474
473
    if (!token)
475
474
        return;
476
475
 
477
 
    isScreen = TRUE;
478
476
    sscanf (token, "screen%d", &screenNum);
479
477
 
480
478
    token = strsep (&keyName, "/"); /* 'options' */
491
489
 
492
490
    readInit (context);
493
491
    if (!readOption (setting))
494
 
        ccsResetToDefault (setting);
 
492
        ccsResetToDefault (setting, TRUE);
495
493
 
496
494
    if (ccsGetIntegrationEnabled (context) &&
497
495
        isIntegratedOption (setting, &index))
572
570
            {
573
571
                for (i = 0; i < 1; i++)
574
572
                {
575
 
                    unsigned int screen;
576
 
 
577
 
                    screen = 0;
578
 
 
579
573
                    setting = ccsFindSetting (plugin, (char*) opt->settingName);
580
574
 
581
575
                    if (setting)
822
816
    valueList = gconf_value_get_list (gconfValue);
823
817
    if (!valueList)
824
818
    {
825
 
        ccsSetList (setting, NULL);
 
819
        ccsSetList (setting, NULL, TRUE);
826
820
        return TRUE;
827
821
    }
828
822
 
906
900
 
907
901
    if (list)
908
902
    {
909
 
        ccsSetList (setting, list);
 
903
        ccsSetList (setting, list, TRUE);
910
904
        ccsSettingValueListFree (list, TRUE);
911
905
        return TRUE;
912
906
    }
987
981
            guint value;
988
982
 
989
983
            value = gconf_value_get_int (gconfValue);
990
 
            ccsSetInt (setting, value);
 
984
            ccsSetInt (setting, value, TRUE);
991
985
            ret = TRUE;
992
986
        }
993
987
        break;
997
991
            gboolean value;
998
992
 
999
993
            value = gconf_value_get_bool (gconfValue);
1000
 
            ccsSetBool (setting, value ? TRUE : FALSE);
 
994
            ccsSetBool (setting, value ? TRUE : FALSE, TRUE);
1001
995
            ret = TRUE;
1002
996
        }
1003
997
        break;
1009
1003
            value = gconf_value_get_string (gconfValue);
1010
1004
            if (value)
1011
1005
            {
1012
 
                ccsSetString (setting, value);
 
1006
                ccsSetString (setting, value, TRUE);
1013
1007
                ret = TRUE;
1014
1008
            }
1015
1009
        }
1028
1022
                ccsGetKey (setting, &key);
1029
1023
                if (ccsStringToKeyBinding (value, &key))
1030
1024
                {
1031
 
                    ccsSetKey (setting, key);
 
1025
                    ccsSetKey (setting, key, TRUE);
1032
1026
                    ret = TRUE;
1033
1027
                }
1034
1028
            }
1046
1040
                    gboolean showAll;
1047
1041
 
1048
1042
                    showAll = gconf_value_get_bool (gconfValue);
1049
 
                    ccsSetBool (setting, !showAll);
 
1043
                    ccsSetBool (setting, !showAll, TRUE);
1050
1044
                    ret = TRUE;
1051
1045
                }
1052
1046
            }
1062
1056
                        Bool fullscreen;
1063
1057
 
1064
1058
                        fullscreen = strcmp (value, "fullscreen") == 0;
1065
 
                        ccsSetBool (setting, fullscreen);
 
1059
                        ccsSetBool (setting, fullscreen, TRUE);
1066
1060
                        ret = TRUE;
1067
1061
                    }
1068
1062
                }
1078
1072
                    if (focusMode)
1079
1073
                    {
1080
1074
                        Bool clickToFocus = (strcmp (focusMode, "click") == 0);
1081
 
                        ccsSetBool (setting, clickToFocus);
 
1075
                        ccsSetBool (setting, clickToFocus, TRUE);
1082
1076
                        ret = TRUE;
1083
1077
                    }
1084
1078
                }
1109
1103
                else
1110
1104
                    button.button = 1;
1111
1105
 
1112
 
                ccsSetButton (setting, button);
 
1106
                ccsSetButton (setting, button, TRUE);
1113
1107
                ret = TRUE;
1114
1108
            }
1115
1109
        }
1189
1183
            value = gconf_value_get_string (gconfValue);
1190
1184
            if (value)
1191
1185
            {
1192
 
                ccsSetString (setting, value);
 
1186
                ccsSetString (setting, value, TRUE);
1193
1187
                ret = TRUE;
1194
1188
            }
1195
1189
        }
1200
1194
            value = gconf_value_get_string (gconfValue);
1201
1195
            if (value)
1202
1196
            {
1203
 
                ccsSetMatch (setting, value);
 
1197
                ccsSetMatch (setting, value, TRUE);
1204
1198
                ret = TRUE;
1205
1199
            }
1206
1200
        }
1210
1204
            int value;
1211
1205
            value = gconf_value_get_int (gconfValue);
1212
1206
 
1213
 
            ccsSetInt (setting, value);
 
1207
            ccsSetInt (setting, value, TRUE);
1214
1208
            ret = TRUE;
1215
1209
        }
1216
1210
        break;
1219
1213
            gboolean value;
1220
1214
            value = gconf_value_get_bool (gconfValue);
1221
1215
 
1222
 
            ccsSetBool (setting, value ? TRUE : FALSE);
 
1216
            ccsSetBool (setting, value ? TRUE : FALSE, TRUE);
1223
1217
            ret = TRUE;
1224
1218
        }
1225
1219
        break;
1228
1222
            double value;
1229
1223
            value = gconf_value_get_float (gconfValue);
1230
1224
 
1231
 
            ccsSetFloat (setting, (float)value);
 
1225
            ccsSetFloat (setting, (float)value, TRUE);
1232
1226
            ret = TRUE;
1233
1227
        }
1234
1228
        break;
1240
1234
 
1241
1235
            if (value && ccsStringToColor (value, &color))
1242
1236
            {
1243
 
                ccsSetColor (setting, color);
 
1237
                ccsSetColor (setting, color, TRUE);
1244
1238
                ret = TRUE;
1245
1239
            }
1246
1240
        }
1253
1247
 
1254
1248
            if (value && ccsStringToKeyBinding (value, &key))
1255
1249
            {
1256
 
                ccsSetKey (setting, key);
 
1250
                ccsSetKey (setting, key, TRUE);
1257
1251
                ret = TRUE;
1258
1252
            }
1259
1253
        }
1266
1260
 
1267
1261
            if (value && ccsStringToButtonBinding (value, &button))
1268
1262
            {
1269
 
                ccsSetButton (setting, button);
 
1263
                ccsSetButton (setting, button, TRUE);
1270
1264
                ret = TRUE;
1271
1265
            }
1272
1266
        }
1280
1274
            {
1281
1275
                unsigned int edges;
1282
1276
                edges = ccsStringToEdges (value);
1283
 
                ccsSetEdge (setting, edges);
 
1277
                ccsSetEdge (setting, edges, TRUE);
1284
1278
                ret = TRUE;
1285
1279
            }
1286
1280
        }
1290
1284
            gboolean value;
1291
1285
            value = gconf_value_get_bool (gconfValue);
1292
1286
 
1293
 
            ccsSetBell (setting, value ? TRUE : FALSE);
 
1287
            ccsSetBell (setting, value ? TRUE : FALSE, TRUE);
1294
1288
            ret = TRUE;
1295
1289
        }
1296
1290
        break;
1478
1472
        value.button = button;
1479
1473
        value.buttonModMask = buttonModMask;
1480
1474
 
1481
 
        ccsSetButton (s, value);
 
1475
        ccsSetButton (s, value, TRUE);
1482
1476
    }
1483
1477
}
1484
1478
 
1978
1972
        status = readOption (setting);
1979
1973
 
1980
1974
    if (!status)
1981
 
        ccsResetToDefault (setting);
 
1975
        ccsResetToDefault (setting, TRUE);
1982
1976
}
1983
1977
 
1984
1978
static Bool
2040
2034
    {
2041
2035
        name = strrchr (tmp->data, '/');
2042
2036
        if (name && (strcmp (name + 1, DEFAULTPROF) != 0))
2043
 
            ret = ccsStringListAppend (ret, strdup (name + 1));
 
2037
        {
 
2038
            CCSString *str = calloc (1, sizeof (CCSString));
 
2039
            str->value = strdup (name + 1);
 
2040
            ret = ccsStringListAppend (ret, str);
 
2041
        }
2044
2042
 
2045
2043
        g_free (tmp->data);
2046
2044
    }
2049
2047
 
2050
2048
    name = getCurrentProfileName ();
2051
2049
    if (strcmp (name, DEFAULTPROF) != 0)
2052
 
        ret = ccsStringListAppend (ret, name);
 
2050
    {
 
2051
        CCSString *str = calloc (1, sizeof (CCSString));
 
2052
        str->value = name;
 
2053
        ret = ccsStringListAppend (ret, str);
 
2054
    }
2053
2055
    else
2054
2056
        free (name);
2055
2057