diff options
author | Michael Terry <mike@mterry.name> | 2011-02-15 15:41:19 -0500 |
---|---|---|
committer | Michael Terry <mike@mterry.name> | 2011-02-15 15:41:19 -0500 |
commit | fe51dffdecdaeca76ae8dd0c7e736cd7d56bf3a3 (patch) | |
tree | 4f7b7a0eba0458947fe4339bd0cf668cd10aa453 /src | |
parent | 6bc13b2d4f6cab5a349a072d256dcb55418c6ef2 (diff) | |
download | ayatana-indicator-datetime-fe51dffdecdaeca76ae8dd0c7e736cd7d56bf3a3.tar.gz ayatana-indicator-datetime-fe51dffdecdaeca76ae8dd0c7e736cd7d56bf3a3.tar.bz2 ayatana-indicator-datetime-fe51dffdecdaeca76ae8dd0c7e736cd7d56bf3a3.zip |
in prop_cb, value is a GVariant, not a string, which explains why we sometimes get bogus strings in the menu
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-datetime.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c index 2a309d2..6d5afc0 100644 --- a/src/indicator-datetime.c +++ b/src/indicator-datetime.c @@ -1068,14 +1068,14 @@ generate_format_string (IndicatorDatetime * self) /* Whenever we have a property change on a DbusmenuMenuitem we need to be responsive to that. */ static void -indicator_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, gchar * value, indicator_item_t * mi_data) +indicator_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant *value, indicator_item_t * mi_data) { if (!g_strcmp0(prop, APPOINTMENT_MENUITEM_PROP_LABEL)) { /* Set the main label */ - gtk_label_set_text(GTK_LABEL(mi_data->label), value); + gtk_label_set_text(GTK_LABEL(mi_data->label), g_variant_get_string(value, NULL)); } else if (!g_strcmp0(prop, APPOINTMENT_MENUITEM_PROP_RIGHT)) { /* Set the right label */ - gtk_label_set_text(GTK_LABEL(mi_data->right), value); + gtk_label_set_text(GTK_LABEL(mi_data->right), g_variant_get_string(value, NULL)); } else if (!g_strcmp0(prop, APPOINTMENT_MENUITEM_PROP_ICON)) { /* We don't use the value here, which is probably less efficient, but it's easier to use the easy function. And since th value @@ -1106,12 +1106,12 @@ indicator_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, gchar * value, in } } else if (!g_strcmp0(prop, TIMEZONE_MENUITEM_PROP_LABEL)) { /* Set the main label */ - gtk_label_set_text(GTK_LABEL(mi_data->label), value); + gtk_label_set_text(GTK_LABEL(mi_data->label), g_variant_get_string(value, NULL)); } else if (!g_strcmp0(prop, TIMEZONE_MENUITEM_PROP_RIGHT)) { /* Set the right label */ - gtk_label_set_text(GTK_LABEL(mi_data->right), value); + gtk_label_set_text(GTK_LABEL(mi_data->right), g_variant_get_string(value, NULL)); } else if (!g_strcmp0(prop, TIMEZONE_MENUITEM_PROP_RADIO)) { - //gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mi_data->radio), value); + //gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(mi_data->radio), g_variant_get_boolean(value)); } else { g_warning("Indicator Item property '%s' unknown", prop); } |