---
name: "Gnome2::GConf::Client"
section: "3pm"
platform: "linux"
package: "libgnome2-gconf-perl"
version: "1.044-6+b1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/Gnome2::GConf::Client"
---

# Gnome2::GConf::Client(3pm)

client module for GConf

## NAME

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

## DESCRIPTION

Gnome2::GConf::Client is a commodity class based on `"GObject"` used to access the default `"GConfEngine"` provided by the GConf daemon.  It has a cache, finer-grained notification of changes and a default error handling mechanism.

## ERROR HANDLING

In C, each fallible function has a `"GError"` optional argument: by setting it to a valid `"GError"` structure, the function will fill it in case of error; by passing a NULL value, the function will silently fail.

In Perl, each fallible method has a boolean `"check_error"` argument; by setting this argument to `"TRUE"`, the method will croak con failure, otherwise it will silently fail.

**NOTE**: To retain backward compatibility, the default behaviour is to check each error; that is, the `"check_error"` argument silently is set to TRUE.

In order to catch an error, you might use eval as a try...catch equivalent:

```
  eval { $s = $client->get_string($some_key); 1; };
  if (Glib::Error::matches($@, 'Gnome2::GConf::Error', 'bad-key'))
  {
    # recover from a bad-key error.
  }
```

On failure, if the error is unchecked, the `"unreturned_error"` signal will be fired by the Gnome2::GConf::Client object; the `"error"` signal will **always** be fired, whether the error is checked or not.

If you want to let the global error handler function catch just the unchecked error, use the `"Gnome2::GConf::Client::set_error_handling"` method, and attach a callback to the `"unreturned_error"` signal:

```
  $client->set_error_handling('handle-unreturned');
  $client->signal_connect(unreturned_error => sub {
      my ($client, $error) = @_;
      warn $error; # is a Glib::Error
    });
```

## HIERARCHY

```
  Glib::Object
  +----Gnome2::GConf::Client
```

## METHODS

### $client-\>add\_dir ($dir, $preload, $check\_error=TRUE)

- •

  `$dir` (string)

- •

  `$preload` (Gnome2::GConf::ClientPreloadType)

- •

  `$check_error` (boolean)

### list = $client-\>all\_dirs($dir, $check\_error=TRUE)

- •

  `$dir` (string)

- •

  `$check_error` (boolean)

This method returns an array containing all the directories in a given directory.

### list = $client-\>all\_entries($dir, $check\_error=TRUE)

- •

  `$dir` (string)

- •

  `$check_error` (boolean)

This method returns an array containing all the entries (as Gnome2::GConf::Entry) of a given directory.

### boolean = $client-\>get\_bool ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

### boolean = $client-\>set\_bool ($key, $val, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$val` (boolean)

- •

  `$check_error` (boolean)

Returns FALSE on failure.

### changeset = $client-\>change\_set\_from\_current ($check\_error=TRUE, $key, ...)

- •

  `$check_error` (boolean)

- •

  ... (list) list of keys to add to the changeset

Create a Gnome2::GConf::ChangeSet from a list of keys inside the GConf database.

### $client-\>clear\_cache

### boolean = $client-\>commit\_change\_set ($cs, $remove\_committed, $check\_error=TRUE)

### (boolean, changeset) = $client-\>commit\_change\_set ($cs, $remove\_committed, $check\_error=TRUE)

- •

  `$cs` (changeset)

- •

  `$remove_committed` (boolean)

- •

  `$check_error` (boolean)

Commit a given Gnome2::GConf::ChangeSet.  In scalar context, or if *$remove\_committed* is FALSE, return a boolean value; otherwise, return the boolean value and the Gnome2::GConf::ChangeSet *$cs*, pruned of the successfully committed changes.

### value = $client-\>get\_default\_from\_schema ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

### client = Gnome2::GConf::Client-\>get\_default

### boolean = $client-\>dir\_exists ($dir, $check\_error=TRUE)

- •

  `$dir` (string)

- •

  `$check_error` (boolean)

### entry = $client-\>get\_entry ($key, $locale, $use\_schema\_default, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$locale` (string)

- •

  `$use_schema_default` (boolean)

- •

  `$check_error` (boolean)

### list = $client-\>error ($error)

- •

  `$error` (scalar) a Glib::Error

You should not use this method. This method emits the "error" signal.

### $client-\>set\_error\_handling ($mode)

- •

  `$mode` (Gnome2::GConf::ClientErrorHandlingMode)

### double = $client-\>get\_float ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

### boolean = $client-\>set\_float ($key, $val, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$val` (double)

- •

  `$check_error` (boolean)

Returns FALSE on failure.

### client = Gnome2::GConf::Client-\>get\_for\_engine ($engine)

- •

  `$engine` (engine)

### value = $client-\>get ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

Fetch the `"GConfValue"` bound to the give *$key*.

### $client-\>set ($key, $value, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$value` (value)

- •

  `$check_error` (boolean)

Set the `"GConfValue"` *$val* bound to the given *$key*.

### integer = $client-\>get\_int ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

### boolean = $client-\>set\_int ($key, $val, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$val` (integer)

- •

  `$check_error` (boolean)

Returns FALSE on failure.

### boolean = $client-\>key\_is\_writable ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

### $client-\>get\_list ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

### boolean = $client-\>set\_list ($key, $list\_type, $list, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$list_type` (string)

- •

  `$list` (scalar)

- •

  `$check_error` (boolean)

### integer = $client-\>notify\_add ($namespace\_section, $func, $data=undef, $check\_error=TRUE)

- •

  `$namespace_section` (string)

- •

  `$func` (scalar)

- •

  `$data` (scalar)

- •

  `$check_error` (boolean)

### $client-\>notify\_remove ($cnxn\_id)

- •

  `$cnxn_id` (integer)

### $client-\>get\_pair ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

### boolean = $client-\>set\_pair ($key, $car, $cdr, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$car` (value)

- •

  `$cdr` (value)

- •

  `$check_error` (boolean)

### $client-\>preload ($dirname, $type, $check\_error=TRUE)

- •

  `$dirname` (string)

- •

  `$type` (Gnome2::GConf::ClientPreloadType)

- •

  `$check_error` (boolean)

### boolean = $client-\>recursive\_unset ($key, $flags=0, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$flags` (Gnome2::GConf::UnsetFlags)

- •

  `$check_error` (boolean)

Since: gconf 2.3

### $client-\>remove\_dir ($dir, $check\_error=TRUE)

- •

  `$dir` (string)

- •

  `$check_error` (boolean)

### changeset = $client-\>reverse\_change\_set ($cs, $check\_error=TRUE)

- •

  `$cs` (changeset)

- •

  `$check_error` (boolean)

Reverse the given Gnome2::GConf::ChangeSet.

### schema = $client-\>get\_schema ($key)

- •

  `$key` (string)

### boolean = $client-\>set\_schema ($key, $schema, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$schema` (schema)

- •

  `$check_error` (boolean)

### string = $client-\>get\_string ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

### boolean = $client-\>set\_string ($key, $val, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$val` (string)

- •

  `$check_error` (boolean)

Returns FALSE on failure

### $client-\>suggest\_sync ($check\_error=TRUE)

- •

  `$check_error` (boolean)

### list = $client-\>unreturned\_error ($error)

- •

  `$error` (scalar) a Glib::Error

You should not use this method. This method emits the "unreturned-error" signal.

### boolean = $client-\>unset ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

### list = $client-\>value\_changed ($key, $value)

- •

  `$key` (string)

- •

  `$value` (value)

You should not use this method. This method emits the "value-changed" signal.

### value = $client-\>get\_without\_default ($key, $check\_error=TRUE)

- •

  `$key` (string)

- •

  `$check_error` (boolean)

## SIGNALS

- **error** (Gnome2::GConf::Client, gpointer)

  - **unreturned-error** (Gnome2::GConf::Client, gpointer)

  - **value-changed** (Gnome2::GConf::Client, string, gpointer)

  ## ENUMS AND FLAGS

### enum Gnome2::GConf::ClientErrorHandlingMode

- •

  'handle-none' / 'GCONF\_CLIENT\_HANDLE\_NONE'

- •

  'handle-unreturned' / 'GCONF\_CLIENT\_HANDLE\_UNRETURNED'

- •

  'handle-all' / 'GCONF\_CLIENT\_HANDLE\_ALL'

### enum Gnome2::GConf::ClientPreloadType

- •

  'preload-none' / 'GCONF\_CLIENT\_PRELOAD\_NONE'

- •

  'preload-onelevel' / 'GCONF\_CLIENT\_PRELOAD\_ONELEVEL'

- •

  'preload-recursive' / 'GCONF\_CLIENT\_PRELOAD\_RECURSIVE'

### flags Gnome2::GConf::UnsetFlags

- •

  'names' / 'GCONF\_UNSET\_INCLUDING\_SCHEMA\_NAMES'

## SEE ALSO

Gnome2::GConf, Glib::Object

## COPYRIGHT

Copyright (C) 2003-2006 by the gtk2-perl team.

This software is licensed under the LGPL.  See Gnome2::GConf for a full notice.
