aboutsummaryrefslogtreecommitdiff
path: root/src/libcustomindicator
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2009-10-21 12:10:38 -0500
committerTed Gould <ted@canonical.com>2009-10-21 12:10:38 -0500
commitb08b15860537896f3605c0c701957966995f014c (patch)
tree53bac96bd55eeb6879cd256492157d64424c5fe8 /src/libcustomindicator
parent5e1d1d9aee14f8771f89c98004299575a35e89b7 (diff)
downloadlibayatana-appindicator-b08b15860537896f3605c0c701957966995f014c.tar.gz
libayatana-appindicator-b08b15860537896f3605c0c701957966995f014c.tar.bz2
libayatana-appindicator-b08b15860537896f3605c0c701957966995f014c.zip
Making sure to signal if we change the status.
Diffstat (limited to 'src/libcustomindicator')
-rw-r--r--src/libcustomindicator/custom-indicator.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libcustomindicator/custom-indicator.c b/src/libcustomindicator/custom-indicator.c
index c16f052..07c0f68 100644
--- a/src/libcustomindicator/custom-indicator.c
+++ b/src/libcustomindicator/custom-indicator.c
@@ -370,14 +370,21 @@ custom_indicator_set_property (GObject * object, guint prop_id, const GValue * v
}
break;
/* *********************** */
- case PROP_STATUS:
+ case PROP_STATUS: {
+ gboolean changed = FALSE;
if (G_VALUE_HOLDS_ENUM(value)) {
+ if (priv->status != g_value_get_enum(value)) {
+ changed = TRUE;
+ }
priv->status = g_value_get_enum(value);
} else if (G_VALUE_HOLDS_STRING(value)) {
GParamSpecEnum * enumspec = G_PARAM_SPEC_ENUM(pspec);
if (enumspec != NULL) {
GEnumValue * enumval = g_enum_get_value_by_nick(enumspec->enum_class, g_value_get_string(value));
if (enumval != NULL) {
+ if (priv->status != enumval->value) {
+ changed = TRUE;
+ }
priv->status = enumval->value;
} else {
g_error("Value '%s' is not in the '%s' property enum.", g_value_get_string(value), PROP_STATUS_S);
@@ -388,7 +395,11 @@ custom_indicator_set_property (GObject * object, guint prop_id, const GValue * v
} else {
WARN_BAD_TYPE(PROP_STATUS_S, value);
}
+ if (changed) {
+ g_signal_emit(object, signals[NEW_STATUS], 0, priv->status, TRUE);
+ }
break;
+ }
/* *********************** */
case PROP_ICON_NAME:
if (G_VALUE_HOLDS_STRING(value)) {