1Gnome2::GConf::Client(3U)ser Contributed Perl DocumentatiGonnome2::GConf::Client(3)
2
3
4
6 Gnome2::GConf::Client
7
9 Gnome2::GConf::Client is a commodity class based on "GObject" used to
10 access the default "GConfEngine" provided by the GConf daemon. It has
11 a cache, finer-grained notification of changes and a default error
12 handling mechanism.
13
15 In C, each fallible function has a "GError" optional argument: by
16 setting it to a valid "GError" structure, the function will fill it in
17 case of error; by passing a NULL value, the function will silently
18 fail.
19
20 In Perl, each fallible method has a boolean "check_error" argument; by
21 setting this argument to "TRUE", the method will croak con failure,
22 otherwise it will silently fail.
23
24 NOTE: To retain backward compatibility, the default behaviour is to
25 check each error; that is, the "check_error" argument silently is set
26 to TRUE.
27
28 In order to catch an error, you might use eval as a try...catch
29 equivalent:
30
31 eval { $s = $client->get_string($some_key); 1; };
32 if (Glib::Error::matches($@, 'Gnome2::GConf::Error', 'bad-key'))
33 {
34 # recover from a bad-key error.
35 }
36
37 On failure, if the error is unchecked, the "unreturned_error" signal
38 will be fired by the Gnome2::GConf::Client object; the "error" signal
39 will always be fired, whether the error is checked or not.
40
41 If you want to let the global error handler function catch just the
42 unchecked error, use the "Gnome2::GConf::Client::set_error_handling"
43 method, and attach a callback to the "unreturned_error" signal:
44
45 $client->set_error_handling('handle-unreturned');
46 $client->signal_connect(unreturned_error => sub {
47 my ($client, $error) = @_;
48 warn $error; # is a Glib::Error
49 });
50
52 Glib::Object
53 +----Gnome2::GConf::Client
54
56 $client->add_dir ($dir, $preload, $check_error=TRUE)
57 · $dir (string)
58
59 · $preload (Gnome2::GConf::ClientPreloadType)
60
61 · $check_error (boolean)
62
63 list = $client->all_dirs($dir, $check_error=TRUE)
64 · $dir (string)
65
66 · $check_error (boolean)
67
68 This method returns an array containing all the directories in a
69 given directory.
70
71 list = $client->all_entries($dir, $check_error=TRUE)
72 · $dir (string)
73
74 · $check_error (boolean)
75
76 This method returns an array containing all the entries (as
77 Gnome2::GConf::Entry) of a given directory.
78
79 boolean = $client->get_bool ($key, $check_error=TRUE)
80 · $key (string)
81
82 · $check_error (boolean)
83
84 boolean = $client->set_bool ($key, $val, $check_error=TRUE)
85 · $key (string)
86
87 · $val (boolean)
88
89 · $check_error (boolean)
90
91 Returns FALSE on failure.
92
93 changeset = $client->change_set_from_current ($check_error=TRUE, $key, ...)
94 · $check_error (boolean)
95
96 · ... (list) list of keys to add to the changeset
97
98 Create a Gnome2::GConf::ChangeSet from a list of keys inside the
99 GConf database.
100
101 $client->clear_cache
102 boolean = $client->commit_change_set ($cs, $remove_committed,
103 $check_error=TRUE)
104 (boolean, changeset) = $client->commit_change_set ($cs, $remove_committed,
105 $check_error=TRUE)
106 · $cs (changeset)
107
108 · $remove_committed (boolean)
109
110 · $check_error (boolean)
111
112 Commit a given Gnome2::GConf::ChangeSet. In scalar context, or if
113 $remove_committed is FALSE, return a boolean value; otherwise,
114 return the boolean value and the Gnome2::GConf::ChangeSet $cs,
115 pruned of the successfully committed changes.
116
117 value = $client->get_default_from_schema ($key, $check_error=TRUE)
118 · $key (string)
119
120 · $check_error (boolean)
121
122 client = Gnome2::GConf::Client->get_default
123 boolean = $client->dir_exists ($dir, $check_error=TRUE)
124 · $dir (string)
125
126 · $check_error (boolean)
127
128 entry = $client->get_entry ($key, $locale, $use_schema_default,
129 $check_error=TRUE)
130 · $key (string)
131
132 · $locale (string)
133
134 · $use_schema_default (boolean)
135
136 · $check_error (boolean)
137
138 list = $client->error ($error)
139 · $error (scalar) a Glib::Error
140
141 You should not use this method. This method emits the "error"
142 signal.
143
144 $client->set_error_handling ($mode)
145 · $mode (Gnome2::GConf::ClientErrorHandlingMode)
146
147 double = $client->get_float ($key, $check_error=TRUE)
148 · $key (string)
149
150 · $check_error (boolean)
151
152 boolean = $client->set_float ($key, $val, $check_error=TRUE)
153 · $key (string)
154
155 · $val (double)
156
157 · $check_error (boolean)
158
159 Returns FALSE on failure.
160
161 client = Gnome2::GConf::Client->get_for_engine ($engine)
162 · $engine (engine)
163
164 value = $client->get ($key, $check_error=TRUE)
165 · $key (string)
166
167 · $check_error (boolean)
168
169 Fetch the "GConfValue" bound to the give $key.
170
171 $client->set ($key, $value, $check_error=TRUE)
172 · $key (string)
173
174 · $value (value)
175
176 · $check_error (boolean)
177
178 Set the "GConfValue" $val bound to the given $key.
179
180 integer = $client->get_int ($key, $check_error=TRUE)
181 · $key (string)
182
183 · $check_error (boolean)
184
185 boolean = $client->set_int ($key, $val, $check_error=TRUE)
186 · $key (string)
187
188 · $val (integer)
189
190 · $check_error (boolean)
191
192 Returns FALSE on failure.
193
194 boolean = $client->key_is_writable ($key, $check_error=TRUE)
195 · $key (string)
196
197 · $check_error (boolean)
198
199 $client->get_list ($key, $check_error=TRUE)
200 · $key (string)
201
202 · $check_error (boolean)
203
204 boolean = $client->set_list ($key, $list_type, $list, $check_error=TRUE)
205 · $key (string)
206
207 · $list_type (string)
208
209 · $list (scalar)
210
211 · $check_error (boolean)
212
213 integer = $client->notify_add ($namespace_section, $func, $data=undef,
214 $check_error=TRUE)
215 · $namespace_section (string)
216
217 · $func (scalar)
218
219 · $data (scalar)
220
221 · $check_error (boolean)
222
223 $client->notify_remove ($cnxn_id)
224 · $cnxn_id (integer)
225
226 $client->get_pair ($key, $check_error=TRUE)
227 · $key (string)
228
229 · $check_error (boolean)
230
231 boolean = $client->set_pair ($key, $car, $cdr, $check_error=TRUE)
232 · $key (string)
233
234 · $car (value)
235
236 · $cdr (value)
237
238 · $check_error (boolean)
239
240 $client->preload ($dirname, $type, $check_error=TRUE)
241 · $dirname (string)
242
243 · $type (Gnome2::GConf::ClientPreloadType)
244
245 · $check_error (boolean)
246
247 boolean = $client->recursive_unset ($key, $flags=0, $check_error=TRUE)
248 · $key (string)
249
250 · $flags (Gnome2::GConf::UnsetFlags)
251
252 · $check_error (boolean)
253
254 Since: gconf 2.3
255
256 $client->remove_dir ($dir, $check_error=TRUE)
257 · $dir (string)
258
259 · $check_error (boolean)
260
261 changeset = $client->reverse_change_set ($cs, $check_error=TRUE)
262 · $cs (changeset)
263
264 · $check_error (boolean)
265
266 Reverse the given Gnome2::GConf::ChangeSet.
267
268 schema = $client->get_schema ($key)
269 · $key (string)
270
271 boolean = $client->set_schema ($key, $schema, $check_error=TRUE)
272 · $key (string)
273
274 · $schema (schema)
275
276 · $check_error (boolean)
277
278 string = $client->get_string ($key, $check_error=TRUE)
279 · $key (string)
280
281 · $check_error (boolean)
282
283 boolean = $client->set_string ($key, $val, $check_error=TRUE)
284 · $key (string)
285
286 · $val (string)
287
288 · $check_error (boolean)
289
290 Returns FALSE on failure
291
292 $client->suggest_sync ($check_error=TRUE)
293 · $check_error (boolean)
294
295 list = $client->unreturned_error ($error)
296 · $error (scalar) a Glib::Error
297
298 You should not use this method. This method emits the "unreturned-
299 error" signal.
300
301 boolean = $client->unset ($key, $check_error=TRUE)
302 · $key (string)
303
304 · $check_error (boolean)
305
306 list = $client->value_changed ($key, $value)
307 · $key (string)
308
309 · $value (value)
310
311 You should not use this method. This method emits the "value-
312 changed" signal.
313
314 value = $client->get_without_default ($key, $check_error=TRUE)
315 · $key (string)
316
317 · $check_error (boolean)
318
320 value-changed (Gnome2::GConf::Client, string, gpointer)
321 unreturned-error (Gnome2::GConf::Client, gpointer)
322 error (Gnome2::GConf::Client, gpointer)
323
325 enum Gnome2::GConf::ClientErrorHandlingMode
326 · 'handle-none' / 'GCONF_CLIENT_HANDLE_NONE'
327
328 · 'handle-unreturned' / 'GCONF_CLIENT_HANDLE_UNRETURNED'
329
330 · 'handle-all' / 'GCONF_CLIENT_HANDLE_ALL'
331
332 enum Gnome2::GConf::ClientPreloadType
333 · 'preload-none' / 'GCONF_CLIENT_PRELOAD_NONE'
334
335 · 'preload-onelevel' / 'GCONF_CLIENT_PRELOAD_ONELEVEL'
336
337 · 'preload-recursive' / 'GCONF_CLIENT_PRELOAD_RECURSIVE'
338
339 flags Gnome2::GConf::UnsetFlags
340 · 'names' / 'GCONF_UNSET_INCLUDING_SCHEMA_NAMES'
341
343 Gnome2::GConf, Glib::Object
344
346 Copyright (C) 2003-2006 by the gtk2-perl team.
347
348 This software is licensed under the LGPL. See Gnome2::GConf for a full
349 notice.
350
351
352
353perl v5.12.0 2010-05-12 Gnome2::GConf::Client(3)