~audio-recorder/audio-recorder/trunk

« back to all changes in this revision

Viewing changes to src/dconf.c

  • Committer: Osmo Antero
  • Date: 2015-02-06 14:13:34 UTC
  • Revision ID: osmoma@gmail.com-20150206141334-ifaeqyan4ygxo49g
Updated README and INSTALL files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 *
9
9
 * This library is distributed in the hope that it will be useful,
10
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
12
 * See the GNU Library General Public License 3 for more details.
13
13
 *
14
14
 * You should have received a copy of the GNU Library General Public
147
147
GSettings *conf_get_base_settings() {
148
148
    // Return GSettings (base) object. This points to /apps/audio-recorder/.
149
149
 
150
 
    #if 0 
151
 
        // This code failed on some Linux-distributions. Reverting to g_settings_new().
152
 
 
153
 
        // Ref: http://developer.gnome.org/gio/2.32/gio-GSettingsSchema-GSettingsSchemaSource.html
154
 
        GSettingsSchemaSource *source = g_settings_schema_source_get_default();
155
 
        GSettingsSchema *schema = g_settings_schema_source_lookup(source, APPLICATION_SETTINGS_SCHEMA, TRUE);
156
 
 
157
 
        // Check if schema has been installed
158
 
        if (!schema) {
159
 
            g_printerr("Error: Cannot find settings for %s in GNOME's registry. " 
160
 
                       "Please run \"make install\" as sudo or root user.\n", "/apps/audio-recorder/");
161
 
        }
162
 
 
163
 
        GSettings *settings = g_settings_new_full(schema, NULL, NULL);
164
 
        g_settings_schema_unref(schema);
165
 
    #endif
 
150
#if 0
 
151
    // This code failed on some Linux-distributions. Reverting to g_settings_new().
 
152
 
 
153
    // Ref: http://developer.gnome.org/gio/2.32/gio-GSettingsSchema-GSettingsSchemaSource.html
 
154
    GSettingsSchemaSource *source = g_settings_schema_source_get_default();
 
155
    GSettingsSchema *schema = g_settings_schema_source_lookup(source, APPLICATION_SETTINGS_SCHEMA, TRUE);
 
156
 
 
157
    // Check if schema has been installed
 
158
    if (!schema) {
 
159
        g_printerr("Error: Cannot find settings for %s in GNOME's registry. "
 
160
                   "Please run \"make install\" as sudo or root user.\n", "/apps/audio-recorder/");
 
161
    }
 
162
 
 
163
    GSettings *settings = g_settings_new_full(schema, NULL, NULL);
 
164
    g_settings_schema_unref(schema);
 
165
#endif
166
166
 
167
167
    GSettings *settings = g_settings_new(APPLICATION_SETTINGS_SCHEMA);
168
168
    if (!G_IS_SETTINGS(settings)) {
169
 
        g_printerr("Error: Cannot find settings for %s in GNOME's registry. " 
 
169
        g_printerr("Error: Cannot find settings for %s in GNOME's registry. "
170
170
                   "Please run \"make install\" as sudo or root user.\n", "/apps/audio-recorder/");
171
171
    }
172
172