~malept/awn/desktop-agnostic

« back to all changes in this revision

Viewing changes to libawn/awn-config-client.c

  • Committer: Mark Lee
  • Date: 2007-11-22 07:18:01 UTC
  • Revision ID: bzr@lazymalevolence.com-20071122071801-o0oa9m5u40cs11xp
libawn/awn-config-client.c: fix some segfaults

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
#ifdef USE_GCONF
172
172
        return awn_config_client_new_with_path (g_strconcat (AWN_GCONF_KEY_PREFIX, "/applets/", name, NULL));
173
173
#else
 
174
        /* TODO: add ~/.config/awn/applets if it doesn't exist */
174
175
        AwnConfigClient *client = awn_config_client_new_with_path (g_build_filename (g_get_user_config_dir (), "awn", "applets", g_strconcat(name, ".ini", NULL), NULL));
175
176
        awn_config_client_gkeyfile_new_schema (client, name);
176
177
        return client;
370
371
        gchar *data;
371
372
        gsize len;
372
373
        data = g_key_file_to_data (client->client, &len, err);
373
 
        if (!*err) {
 
374
        if (!err || !*err) {
374
375
                g_file_set_contents (client->path, data, len, err);
375
376
                g_free (data);
376
377
        }
461
462
                        GKeyFile *old_client = client->client;
462
463
                        client->client = g_key_file_new ();
463
464
                        awn_config_client_load_data (client);
464
 
                        if (strcmp (old_checksum, client->checksum) != 0) {
 
465
                        if (!old_checksum || strcmp (old_checksum, client->checksum) != 0) {
465
466
                                /* iterate through all of the groups/keys to see if anything's changed */
466
467
                                /* merge groups into one array */
467
468
                                gsize og_len, ng_len, i, groups_len;