Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Add a delay-apply property to GSettings
Browse files Browse the repository at this point in the history
Bug 637147, patch by Matt Barnes.
  • Loading branch information
Matthias Clasen committed Dec 20, 2010
1 parent 21c764c commit bc4e1fc
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions gio/gsettings.c
Expand Up @@ -222,6 +222,7 @@ enum
PROP_BACKEND,
PROP_PATH,
PROP_HAS_UNAPPLIED,
PROP_DELAY_APPLY
};

enum
Expand Down Expand Up @@ -447,6 +448,10 @@ g_settings_get_property (GObject *object,
g_value_set_boolean (value, g_settings_get_has_unapplied (settings));
break;

case PROP_DELAY_APPLY:
g_value_set_boolean (value, settings->priv->delayed != NULL);
break;

default:
g_assert_not_reached ();
}
Expand Down Expand Up @@ -696,6 +701,20 @@ g_settings_class_init (GSettingsClass *class)
FALSE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));

/**
* GSettings:delay-apply:
*
* Whether the #GSettings object is in 'delay-apply' mode. See
* g_settings_delay() for details.
*
* Since: 2.28
*/
g_object_class_install_property (object_class, PROP_DELAY_APPLY,
g_param_spec_boolean ("delay-apply",
P_("Delay-apply mode"),
P_("Whether this settings object is in 'delay-apply' mode"),
FALSE,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
}

/* Construction (new, new_with_path, etc.) {{{1 */
Expand Down Expand Up @@ -1971,6 +1990,8 @@ g_settings_delay (GSettings *settings)
g_settings_backend_watch (settings->priv->backend,
&listener_vtable, G_OBJECT (settings),
settings->priv->main_context);

g_object_notify (G_OBJECT (settings), "delay-apply");
}

/**
Expand Down

0 comments on commit bc4e1fc

Please sign in to comment.