1Gnome2::GConf::Client(3U)ser Contributed Perl DocumentatiGonnome2::GConf::Client(3)
2
3
4

NAME

6       Gnome2::GConf::Client -  client module for GConf
7

DESCRIPTION

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

ERROR HANDLING

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

HIERARCHY

52         Glib::Object
53         +----Gnome2::GConf::Client
54

METHODS

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 given
69       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 GConf
99       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, return
114       the boolean value and the Gnome2::GConf::ChangeSet $cs, pruned of the
115       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" signal.
142
143   $client->set_error_handling ($mode)
144       ·   $mode (Gnome2::GConf::ClientErrorHandlingMode)
145
146   double = $client->get_float ($key, $check_error=TRUE)
147       ·   $key (string)
148
149       ·   $check_error (boolean)
150
151   boolean = $client->set_float ($key, $val, $check_error=TRUE)
152       ·   $key (string)
153
154       ·   $val (double)
155
156       ·   $check_error (boolean)
157
158       Returns FALSE on failure.
159
160   client = Gnome2::GConf::Client->get_for_engine ($engine)
161       ·   $engine (engine)
162
163   value = $client->get ($key, $check_error=TRUE)
164       ·   $key (string)
165
166       ·   $check_error (boolean)
167
168       Fetch the "GConfValue" bound to the give $key.
169
170   $client->set ($key, $value, $check_error=TRUE)
171       ·   $key (string)
172
173       ·   $value (value)
174
175       ·   $check_error (boolean)
176
177       Set the "GConfValue" $val bound to the given $key.
178
179   integer = $client->get_int ($key, $check_error=TRUE)
180       ·   $key (string)
181
182       ·   $check_error (boolean)
183
184   boolean = $client->set_int ($key, $val, $check_error=TRUE)
185       ·   $key (string)
186
187       ·   $val (integer)
188
189       ·   $check_error (boolean)
190
191       Returns FALSE on failure.
192
193   boolean = $client->key_is_writable ($key, $check_error=TRUE)
194       ·   $key (string)
195
196       ·   $check_error (boolean)
197
198   $client->get_list ($key, $check_error=TRUE)
199       ·   $key (string)
200
201       ·   $check_error (boolean)
202
203   boolean = $client->set_list ($key, $list_type, $list, $check_error=TRUE)
204       ·   $key (string)
205
206       ·   $list_type (string)
207
208       ·   $list (scalar)
209
210       ·   $check_error (boolean)
211
212   integer = $client->notify_add ($namespace_section, $func, $data=undef,
213       $check_error=TRUE)
214       ·   $namespace_section (string)
215
216       ·   $func (scalar)
217
218       ·   $data (scalar)
219
220       ·   $check_error (boolean)
221
222   $client->notify_remove ($cnxn_id)
223       ·   $cnxn_id (integer)
224
225   $client->get_pair ($key, $check_error=TRUE)
226       ·   $key (string)
227
228       ·   $check_error (boolean)
229
230   boolean = $client->set_pair ($key, $car, $cdr, $check_error=TRUE)
231       ·   $key (string)
232
233       ·   $car (value)
234
235       ·   $cdr (value)
236
237       ·   $check_error (boolean)
238
239   $client->preload ($dirname, $type, $check_error=TRUE)
240       ·   $dirname (string)
241
242       ·   $type (Gnome2::GConf::ClientPreloadType)
243
244       ·   $check_error (boolean)
245
246   boolean = $client->recursive_unset ($key, $flags=0, $check_error=TRUE)
247       ·   $key (string)
248
249       ·   $flags (Gnome2::GConf::UnsetFlags)
250
251       ·   $check_error (boolean)
252
253       Since: gconf 2.3
254
255   $client->remove_dir ($dir, $check_error=TRUE)
256       ·   $dir (string)
257
258       ·   $check_error (boolean)
259
260   changeset = $client->reverse_change_set ($cs, $check_error=TRUE)
261       ·   $cs (changeset)
262
263       ·   $check_error (boolean)
264
265       Reverse the given Gnome2::GConf::ChangeSet.
266
267   schema = $client->get_schema ($key)
268       ·   $key (string)
269
270   boolean = $client->set_schema ($key, $schema, $check_error=TRUE)
271       ·   $key (string)
272
273       ·   $schema (schema)
274
275       ·   $check_error (boolean)
276
277   string = $client->get_string ($key, $check_error=TRUE)
278       ·   $key (string)
279
280       ·   $check_error (boolean)
281
282   boolean = $client->set_string ($key, $val, $check_error=TRUE)
283       ·   $key (string)
284
285       ·   $val (string)
286
287       ·   $check_error (boolean)
288
289       Returns FALSE on failure
290
291   $client->suggest_sync ($check_error=TRUE)
292       ·   $check_error (boolean)
293
294   list = $client->unreturned_error ($error)
295       ·   $error (scalar) a Glib::Error
296
297       You should not use this method.  This method emits the "unreturned-
298       error" signal.
299
300   boolean = $client->unset ($key, $check_error=TRUE)
301       ·   $key (string)
302
303       ·   $check_error (boolean)
304
305   list = $client->value_changed ($key, $value)
306       ·   $key (string)
307
308       ·   $value (value)
309
310       You should not use this method.  This method emits the "value-changed"
311       signal.
312
313   value = $client->get_without_default ($key, $check_error=TRUE)
314       ·   $key (string)
315
316       ·   $check_error (boolean)
317

SIGNALS

319       error (Gnome2::GConf::Client, gpointer)
320       unreturned-error (Gnome2::GConf::Client, gpointer)
321       value-changed (Gnome2::GConf::Client, string, gpointer)
322

ENUMS AND FLAGS

324   enum Gnome2::GConf::ClientErrorHandlingMode
325       ·   'handle-none' / 'GCONF_CLIENT_HANDLE_NONE'
326
327       ·   'handle-unreturned' / 'GCONF_CLIENT_HANDLE_UNRETURNED'
328
329       ·   'handle-all' / 'GCONF_CLIENT_HANDLE_ALL'
330
331   enum Gnome2::GConf::ClientPreloadType
332       ·   'preload-none' / 'GCONF_CLIENT_PRELOAD_NONE'
333
334       ·   'preload-onelevel' / 'GCONF_CLIENT_PRELOAD_ONELEVEL'
335
336       ·   'preload-recursive' / 'GCONF_CLIENT_PRELOAD_RECURSIVE'
337
338   flags Gnome2::GConf::UnsetFlags
339       ·   'names' / 'GCONF_UNSET_INCLUDING_SCHEMA_NAMES'
340

SEE ALSO

342       Gnome2::GConf, Glib::Object
343
345       Copyright (C) 2003-2006 by the gtk2-perl team.
346
347       This software is licensed under the LGPL.  See Gnome2::GConf for a full
348       notice.
349
350
351
352perl v5.32.0                      2021-01-06          Gnome2::GConf::Client(3)
Impressum