~ubuntu-branches/debian/stretch/alarm-clock-applet/stretch

« back to all changes in this revision

Viewing changes to src/tests/test_gconf_recursive.c

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2009-05-30 23:24:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090530232427-88on1j2ily4ajxdz
Tags: upstream-0.2.6
ImportĀ upstreamĀ versionĀ 0.2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * test_gconf_recursive.c -- Test utility for recursively unsetting a gconf dir.
 
3
 * 
 
4
 * Copyright (C) 2007-2008 Johannes H. Jensen <joh@pseudoberries.com>
 
5
 * 
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
19
 * 
 
20
 * Authors:
 
21
 *              Johannes H. Jensen <joh@pseudoberries.com>
 
22
 */
 
23
 
 
24
#include <glib.h>
 
25
#include <gconf/gconf-client.h>
 
26
 
 
27
 
 
28
static void
 
29
notify (GConfClient *client,
 
30
                guint cnxn_id,
 
31
                GConfEntry *entry,
 
32
                gpointer user_data)
 
33
{
 
34
        g_debug ("notify (%p, %d, %p, %p)", client, cnxn_id, entry, user_data);
 
35
        
 
36
        if (entry) {
 
37
                g_debug ("\t%s = %p", entry->key, entry->value);
 
38
        }
 
39
}
 
40
 
 
41
int main(void)
 
42
{
 
43
        GConfClient *client;
 
44
        GError *err = NULL;
 
45
        gboolean result;
 
46
        
 
47
        GMainLoop *loop = g_main_loop_new(g_main_context_default(), FALSE);
 
48
        
 
49
        client = gconf_client_get_default();
 
50
        
 
51
        gconf_client_add_dir (client, "/apps/atest", 
 
52
                                                  GCONF_CLIENT_PRELOAD_ONELEVEL, NULL);
 
53
        gconf_client_notify_add (client, "/apps/atest", notify, NULL, NULL, NULL);
 
54
        
 
55
        result = gconf_client_recursive_unset (client, "/apps/atest/foo", GCONF_UNSET_INCLUDING_SCHEMA_NAMES, &err);
 
56
        
 
57
        g_debug ("result: %d", result);
 
58
        g_debug ("err: %p", err);
 
59
        
 
60
        gconf_client_suggest_sync (client, &err);
 
61
        
 
62
        g_debug ("result: %d", result);
 
63
        g_debug ("err: %p", err);
 
64
        
 
65
        g_main_loop_run (loop);
 
66
        
 
67
        //result = gconf_client_unset (client, "/apps/atest/fooz", &err);
 
68
        //result = gconf_client_
 
69
        
 
70
        /*g_debug ("result: %d", result);
 
71
        g_debug ("err: %p", err);*/
 
72
        
 
73
        return 0;
 
74
}
 
 
b'\\ No newline at end of file'