~audio-recorder/audio-recorder/trunk

« back to all changes in this revision

Viewing changes to src/dconf.c

  • Committer: Osmo Antero
  • Date: 2015-09-01 13:49:33 UTC
  • mto: This revision was merged to the branch mainline in revision 644.
  • Revision ID: osmoma@gmail.com-20150901134933-9w1oguk96vingldu
Removed deprecated GLIB 2.46 and GTK 3.16 functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
 
89
89
    // Get list of keys
90
90
    gchar **keys = NULL;
91
 
    keys = g_settings_list_keys(settings);
92
 
 
93
 
    gint i = 0;
94
 
    gboolean found = FALSE;
95
 
    while (keys && keys[i]) {
96
 
        if (!g_strcmp0(key, keys[i])) {
97
 
            found = TRUE;
98
 
            break;
99
 
        }
100
 
        i++;
101
 
    }
102
 
 
103
 
    // Free keys
104
 
    g_strfreev(keys);
105
 
 
106
 
    return found;
107
 
}
108
 
 
109
 
#if 0
110
 
static gboolean conf_is_valid_key_NEW(GSettings *settings, gchar *key) {
111
 
    // Check if the key is valid key within settings
112
 
    if (!G_IS_SETTINGS(settings)) {
113
 
        return FALSE;
114
 
    }
115
 
 
116
 
    // GTK+3
 
91
 
 
92
// Check:
 
93
// $ pkg-config --modversion glib-2.0 
 
94
//
 
95
#if GLIB_CHECK_VERSION(2, 45, 6)
117
96
    GSettingsSchema *schema = NULL;
118
 
    g_object_get (settings, "settings-schema", &schema, NULL);
119
 
 
120
 
    //if (!G_IS_SETTINGS_SCHEMA(schema)) {
121
 
    if (!schema) {
122
 
        return FALSE;
123
 
    }
124
 
 
125
 
    // Get list of keys
126
 
    gchar **keys = NULL;
 
97
    g_object_get(settings, "settings-schema", &schema, NULL);
127
98
    keys = g_settings_schema_list_keys(schema);
 
99
#else
 
100
    keys = g_settings_list_keys(settings);
 
101
#endif
128
102
 
129
103
    gint i = 0;
130
104
    gboolean found = FALSE;
131
105
    while (keys && keys[i]) {
132
106
 
133
 
        GVariant *value = NULL;
134
 
        gchar *str = NULL;
135
 
 
 
107
        //Debug:
 
108
        //GVariant *value = NULL;
 
109
        //gchar *str = NULL;
136
110
        //value = g_settings_get_value (settings, keys[i]);
137
111
        //str = g_variant_print(value, TRUE);
138
112
        //g_print ("%s %s %s\n", g_settings_schema_get_id (schema), keys[i], str);
146
120
        i++;
147
121
    }
148
122
 
149
 
    // Free keys
150
 
 
151
123
    g_strfreev(keys);
 
124
 
 
125
#if GLIB_CHECK_VERSION(2, 45, 6)
152
126
    g_settings_schema_unref(schema);
 
127
#endif
153
128
 
154
129
    return found;
155
130
}
156
 
#endif
157
131
 
158
132
 
159
133
#if 0