[glib] Add a delay-apply property to GSettings
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Add a delay-apply property to GSettings
- Date: Mon, 20 Dec 2010 14:17:01 +0000 (UTC)
commit bc4e1fc622d0bc61f8978a6c3df98d6c0ab12226
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Dec 20 09:16:05 2010 -0500
Add a delay-apply property to GSettings
Bug 637147, patch by Matt Barnes.
gio/gsettings.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/gio/gsettings.c b/gio/gsettings.c
index 58fe0fb..23164b5 100644
--- a/gio/gsettings.c
+++ b/gio/gsettings.c
@@ -222,6 +222,7 @@ enum
PROP_BACKEND,
PROP_PATH,
PROP_HAS_UNAPPLIED,
+ PROP_DELAY_APPLY
};
enum
@@ -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 ();
}
@@ -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 */
@@ -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");
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]