Plank.Preferences – plank Reference Manual

# Preferences

## Object Hierarchy:

## Description:

public abstract class Preferences : Object

The base class for all preferences in the system. Preferences are serialized to files. The file is watched for changes and loads new values if the backing file changed. When any public property of a sub-class is changed, the public properties are serialized to the backing file.

All known sub-classes:

- DockItemPreferences

- DockTheme

- Theme

Namespace: Plank
Package: plank

## Content:

### Creation methods:

- protected Preferences ()
  Creates a new preferences object with no backing file.
- protected Preferences.with_file (File file)
  Creates a preferences object with a backing file.
- protected Preferences.with_filename (string filename)
  Creates a preferences object with a backing filename.

### Methods:

- public void @delete ()
  This forces the deletion of the backing file for this preferences.
- public void apply ()
  If any settings were changed, apply them now.
- public void delay ()
  Delays saving changes to the backing file until apply() is called.
- public unowned File? get_backing_file ()
  Returns the backing file.
- public string get_filename ()
  Returns the filename of the backing file.
- protected void init_from_file (File file)
  Initializes this preferences with a backing file.
- protected void init_from_filename (string filename)
  Initializes this preferences with a backing filename.
- protected abstract void reset_properties ()
  Resets all properties to their default values. Called from construct and before loading from the backing file.
- protected virtual void verify (string prop)
  This method will verify the value of a property. If the value is wrong, this method should replace it with a sanitized value.

### Signals:

- public signal void deleted ()
  This signal indicates that the backing file for this preferences was deleted.

### Inherited Members:

All known members inherited from class GLib.Object

- @get
- @new
- @ref
- @set
- add_toggle_ref
- add_weak_pointer
- bind_property
- connect
- constructed
- disconnect
- dispose
- dup_data
- dup_qdata
- force_floating
- freeze_notify
- get_class
- get_data

- get_property
- get_qdata
- get_type
- getv
- interface_find_property
- interface_install_property
- interface_list_properties
- is_floating
- new_valist
- new_with_properties
- newv
- notify
- notify_property
- ref_count
- ref_sink
- remove_toggle_ref
- remove_weak_pointer

- replace_data
- replace_qdata
- set_data
- set_data_full
- set_property
- set_qdata
- set_qdata_full
- set_valist
- setv
- steal_data
- steal_qdata
- thaw_notify
- unref
- watch_closure
- weak_ref
- weak_unref