IdeSettings: Reference Manual

## IdeSettings IdeSettings — Project and Application Preferences |

## Functions

#define | IDE_TYPE_SETTINGS
const gchar * | ide_settings_get_relative_path ()
const gchar * | ide_settings_get_schema_id ()
gboolean | ide_settings_get_ignore_project_settings ()
GVariant * | ide_settings_get_default_value ()
GVariant * | ide_settings_get_user_value ()
GVariant * | ide_settings_get_value ()
void | ide_settings_set_value ()
gboolean | ide_settings_get_boolean ()
gdouble | ide_settings_get_double ()
gint | ide_settings_get_int ()
gchar * | ide_settings_get_string ()
guint | ide_settings_get_uint ()
void | ide_settings_set_boolean ()
void | ide_settings_set_double ()
void | ide_settings_set_int ()
void | ide_settings_set_string ()
void | ide_settings_set_uint ()
void | ide_settings_bind ()
void | ide_settings_bind_with_mapping ()
void | ide_settings_unbind ()

## Properties

gboolean | ignore-project-settings | Read / Write / Construct Only
gchar * | relative-path | Read / Write / Construct Only
gchar * | schema-id | Read / Write / Construct Only

## Signals

void | changed | Has Details

## Types and Values

| IdeSettings

## Object Hierarchy

        GObject
        ╰── IdeObject
            ╰── IdeSettings

## Description

In Builder, we need support for settings at the user level (their chosen defaults) as well as defaults for a project. IdeSettings attempts to simplify this by providing a layered approach to settings.

If a setting has been set for the current project, it will be returned. If not, the users preference will be returned. Setting a preference via IdeSettings will always modify the projects setting, not the users default settings.

## Functions

### IDE_TYPE_SETTINGS

    #define IDE_TYPE_SETTINGS (ide_settings_get_type())

### ide_settings_get_relative_path ()

    const gchar *
    ide_settings_get_relative_path (IdeSettings *self);

### ide_settings_get_schema_id ()

    const gchar *
    ide_settings_get_schema_id (IdeSettings *self);

### ide_settings_get_ignore_project_settings ()

    gboolean
    ide_settings_get_ignore_project_settings
                                   (IdeSettings *self);

### ide_settings_get_default_value ()

    GVariant *
    ide_settings_get_default_value (IdeSettings *self,
                                    const gchar *key);

### ide_settings_get_user_value ()

    GVariant *
    ide_settings_get_user_value (IdeSettings *self,
                                 const gchar *key);

### ide_settings_get_value ()

    GVariant *
    ide_settings_get_value (IdeSettings *self,
                            const gchar *key);

### ide_settings_set_value ()

    void
    ide_settings_set_value (IdeSettings *self,
                            const gchar *key,
                            GVariant *value);

### ide_settings_get_boolean ()

    gboolean
    ide_settings_get_boolean (IdeSettings *self,
                              const gchar *key);

### ide_settings_get_double ()

    gdouble
    ide_settings_get_double (IdeSettings *self,
                             const gchar *key);

### ide_settings_get_int ()

    gint
    ide_settings_get_int (IdeSettings *self,
                          const gchar *key);

### ide_settings_get_string ()

    gchar *
    ide_settings_get_string (IdeSettings *self,
                             const gchar *key);

### ide_settings_get_uint ()

    guint
    ide_settings_get_uint (IdeSettings *self,
                           const gchar *key);

### ide_settings_set_boolean ()

    void
    ide_settings_set_boolean (IdeSettings *self,
                              const gchar *key,
                              gboolean val);

### ide_settings_set_double ()

    void
    ide_settings_set_double (IdeSettings *self,
                             const gchar *key,
                             gdouble val);

### ide_settings_set_int ()

    void
    ide_settings_set_int (IdeSettings *self,
                          const gchar *key,
                          gint val);

### ide_settings_set_string ()

    void
    ide_settings_set_string (IdeSettings *self,
                             const gchar *key,
                             const gchar *val);

### ide_settings_set_uint ()

    void
    ide_settings_set_uint (IdeSettings *self,
                           const gchar *key,
                           guint val);

### ide_settings_bind ()

    void
    ide_settings_bind (IdeSettings *self,
                       const gchar *key,
                       gpointer object,
                       const gchar *property,
                       GSettingsBindFlags flags);

### ide_settings_bind_with_mapping ()

    void
    ide_settings_bind_with_mapping (IdeSettings *self,
                                    const gchar *key,
                                    gpointer object,
                                    const gchar *property,
                                    GSettingsBindFlags flags,
                                    GSettingsBindGetMapping get_mapping,
                                    GSettingsBindSetMapping set_mapping,
                                    gpointer user_data,
                                    GDestroyNotify destroy);

Like `ide_settings_bind()` but allows transforming to and from settings storage using `get_mapping` and `set_mapping` transformation functions.

Call `ide_settings_unbind()` to unbind the mapping.

#### Parameters

self | An IdeSettings |
key | The settings key |
object | the object to bind to |
property | the property of `object` to bind to |
flags | flags for the binding |
get_mapping | variant to value mapping. | [allow-none][scope notified]
set_mapping | value to variant mapping. | [allow-none][scope notified]
user_data | user data for `get_mapping` and `set_mapping` |
destroy | destroy function to cleanup `user_data` . |

### ide_settings_unbind ()

    void
    ide_settings_unbind (IdeSettings *self,
                         const gchar *property);

## Types and Values

### IdeSettings

    typedef struct _IdeSettings IdeSettings;

## Property Details

### The `“ignore-project-settings”` property

      “ignore-project-settings”  gboolean

If project settings should be ignored.

Flags: Read / Write / Construct Only

Default value: FALSE

### The `“relative-path”` property

      “relative-path”            gchar *

Relative Path.

Flags: Read / Write / Construct Only

Default value: NULL

### The `“schema-id”` property

      “schema-id”                gchar *

Schema ID.

Flags: Read / Write / Construct Only

Default value: NULL

## Signal Details

### The `“changed”` signal

    void
    user_function (IdeSettings *idesettings,
                   gchar       *arg1,
                   gpointer     user_data)

Flags: Has Details