diff options
author | Ted Gould <ted@gould.cx> | 2010-07-15 23:18:47 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-07-15 23:18:47 -0500 |
commit | 56197266a0a3e82b91138988411d5280c96e4569 (patch) | |
tree | d477bb487d94b4e573c3dbfcc9506dfe91ae28d8 | |
parent | 4de10d0ced1994599c040223fcd5012886f3d872 (diff) | |
download | ayatana-indicator-datetime-56197266a0a3e82b91138988411d5280c96e4569.tar.gz ayatana-indicator-datetime-56197266a0a3e82b91138988411d5280c96e4569.tar.bz2 ayatana-indicator-datetime-56197266a0a3e82b91138988411d5280c96e4569.zip |
Adding a mapping function to pull in the enum value.
-rw-r--r-- | src/indicator-datetime.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 13d22e3..eb8394f 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -129,6 +129,8 @@ static void indicator_datetime_dispose (GObject *object); static void indicator_datetime_finalize (GObject *object); static GtkLabel * get_label (IndicatorObject * io); static GtkMenu * get_menu (IndicatorObject * io); +static GVariant * bind_enum_set (const GValue * value, const GVariantType * type, gpointer user_data); +static gboolean bind_enum_get (GValue * value, GVariant * variant, gpointer user_data); /* Indicator Module Config */ INDICATOR_SET_VERSION @@ -219,11 +221,14 @@ indicator_datetime_init (IndicatorDatetime *self) self->priv->settings = g_settings_new(SETTINGS_INTERFACE); if (self->priv->settings != NULL) { - g_settings_bind(self->priv->settings, + g_settings_bind_with_mapping(self->priv->settings, SETTINGS_TIME_FORMAT_S, self, PROP_TIME_FORMAT_S, - G_SETTINGS_BIND_DEFAULT); + G_SETTINGS_BIND_DEFAULT, + bind_enum_get, + bind_enum_set, + NULL, NULL); /* Userdata and destroy func */ g_settings_bind(self->priv->settings, SETTINGS_SHOW_SECONDS_S, self, @@ -311,6 +316,20 @@ indicator_datetime_finalize (GObject *object) return; } +static GVariant * +bind_enum_set (const GValue * value, const GVariantType * type, gpointer user_data) +{ + + return NULL; +} + +static gboolean +bind_enum_get (GValue * value, GVariant * variant, gpointer user_data) +{ + + return FALSE; +} + static void set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { |