summaryrefstree
path: root/usr/share/gtk-doc/html/gio/ch31s03.html
blob: 026fafc2861fa1898d43cb803674e764771de16c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GConfClient (and GConfBridge) API conversion</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="ch31.html" title="Migrating from GConf to GSettings">
<link rel="prev" href="ch31s02.html" title="Conceptual differences">
<link rel="next" href="ch31s04.html" title="Change notification">
<meta name="generator" content="GTK-Doc V1.19 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle">
<td><a accesskey="p" href="ch31s02.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="ch31.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO Reference Manual</th>
<td><a accesskey="n" href="ch31s04.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr></table>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="id-1.5.4.4"></a>GConfClient (and GConfBridge) API conversion</h2></div></div></div>
<p>
        Most people use GConf via the high-level <span class="type">GConfClient</span> API.
        The corresponding API is the <a class="link" href="GSettings.html" title="GSettings"><span class="type">GSettings</span></a> object. While not
        every GConfClient function has a direct GSettings equivalent,
        many do:
        </p>
<div class="table">
<a name="gconf-client-vs-gsettings"></a><p class="title"><b>Table 7. </b></p>
<div class="table-contents"><table border="1">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>GConfClient</th>
<th>GSettings</th>
</tr></thead>
<tbody>
<tr>
<td><code class="function">gconf_client_get_default()</code></td>
<td>no direct equivalent,
                                                                   instead you call <a class="link" href="GSettings.html#g-settings-new" title="g_settings_new ()"><code class="function">g_settings_new()</code></a> for the schemas you use</td>
</tr>
<tr>
<td><code class="function">gconf_client_set()</code></td>
<td><a class="link" href="GSettings.html#g-settings-set" title="g_settings_set ()"><code class="function">g_settings_set()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_get()</code></td>
<td><a class="link" href="GSettings.html#g-settings-get" title="g_settings_get ()"><code class="function">g_settings_get()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_get_bool()</code></td>
<td><a class="link" href="GSettings.html#g-settings-get-boolean" title="g_settings_get_boolean ()"><code class="function">g_settings_get_boolean()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_set_bool()</code></td>
<td><a class="link" href="GSettings.html#g-settings-set-boolean" title="g_settings_set_boolean ()"><code class="function">g_settings_set_boolean()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_get_int()</code></td>
<td><a class="link" href="GSettings.html#g-settings-get-int" title="g_settings_get_int ()"><code class="function">g_settings_get_int()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_set_int()</code></td>
<td><a class="link" href="GSettings.html#g-settings-set-int" title="g_settings_set_int ()"><code class="function">g_settings_set_int()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_get_float()</code></td>
<td><a class="link" href="GSettings.html#g-settings-get-double" title="g_settings_get_double ()"><code class="function">g_settings_get_double()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_set_float()</code></td>
<td><a class="link" href="GSettings.html#g-settings-set-double" title="g_settings_set_double ()"><code class="function">g_settings_set_double()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_get_string()</code></td>
<td><a class="link" href="GSettings.html#g-settings-get-string" title="g_settings_get_string ()"><code class="function">g_settings_get_string()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_set_string()</code></td>
<td><a class="link" href="GSettings.html#g-settings-set-string" title="g_settings_set_string ()"><code class="function">g_settings_set_string()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_get_list()</code></td>
<td>for string lists, see <a class="link" href="GSettings.html#g-settings-get-strv" title="g_settings_get_strv ()"><code class="function">g_settings_get_strv()</code></a>, else see <a class="link" href="GSettings.html#g-settings-get-value" title="g_settings_get_value ()"><code class="function">g_settings_get_value()</code></a> and <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> API</td>
</tr>
<tr>
<td><code class="function">gconf_client_set_list()</code></td>
<td>for string lists, see <a class="link" href="GSettings.html#g-settings-set-strv" title="g_settings_set_strv ()"><code class="function">g_settings_set_strv()</code></a>, else see <a class="link" href="GSettings.html#g-settings-set-value" title="g_settings_set_value ()"><code class="function">g_settings_set_value()</code></a> and <a href="http://library.gnome.org/devel/glib/unstable/glib-GVariant.html#GVariant"><span class="type">GVariant</span></a> API</td>
</tr>
<tr>
<td><code class="function">gconf_entry_get_is_writable()</code></td>
<td><a class="link" href="GSettings.html#g-settings-is-writable" title="g_settings_is_writable ()"><code class="function">g_settings_is_writable()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_client_notify_add()</code></td>
<td>not required, the <a class="link" href="GSettings.html#GSettings-changed" title='The "changed" signal'><span class="type">"changed"</span></a> signal is emitted automatically</td>
</tr>
<tr>
<td><code class="function">gconf_client_add_dir()</code></td>
<td>not required, each GSettings instance automatically watches all keys in its path</td>
</tr>
<tr>
<td><span class="type">GConfChangeSet</span></td>
<td>
<a class="link" href="GSettings.html#g-settings-delay" title="g_settings_delay ()"><code class="function">g_settings_delay()</code></a>, <a class="link" href="GSettings.html#g-settings-apply" title="g_settings_apply ()"><code class="function">g_settings_apply()</code></a>
</td>
</tr>
<tr>
<td><code class="function">gconf_client_get_default_from_schema()</code></td>
<td>no equivalent, applications are expected to know their schema</td>
</tr>
<tr>
<td><code class="function">gconf_client_all_entries()</code></td>
<td>no equivalent, applications are expected to know their schema, and GSettings does not allow schema-less entries</td>
</tr>
<tr>
<td><code class="function">gconf_client_get_without_default()</code></td>
<td>no equivalent</td>
</tr>
<tr>
<td><code class="function">gconf_bridge_bind_property()</code></td>
<td><a class="link" href="GSettings.html#g-settings-bind" title="g_settings_bind ()"><code class="function">g_settings_bind()</code></a></td>
</tr>
<tr>
<td><code class="function">gconf_bridge_bind_property_full()</code></td>
<td><a class="link" href="GSettings.html#g-settings-bind-with-mapping" title="g_settings_bind_with_mapping ()"><code class="function">g_settings_bind_with_mapping()</code></a></td>
</tr>
</tbody>
</table></div>
</div>
<p><br class="table-break">
      </p>
<p>
        GConfBridge was a third-party library that used GConf to bind an object property
        to a particular configuration key. GSettings offers this service itself.
      </p>
<p>
        There is a pattern that is sometimes used for GConf, where a setting can have
        explicit 'value A', explicit 'value B' or 'use the system default'. With GConf,
        'use the system default' is sometimes implemented by unsetting the user value.
      </p>
<p>
        This is not possible in GSettings, since it does not have API to determine if a value
        is the default and does not let you unset values. The recommended way (and much
        clearer) way in which this can be implemented in GSettings is to have a separate
        'use-system-default' boolean setting.
      </p>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.19</div>
</body>
</html>