From 73018411f1b744face28d15b2b73612b11726aba Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 11 Aug 2010 13:00:39 -0500 Subject: Making it so that applications will pass '0' over dbus if they don't have a set ordering index. --- src/app-indicator.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/app-indicator.c') diff --git a/src/app-indicator.c b/src/app-indicator.c index e4138d4..781b630 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -788,11 +788,7 @@ app_indicator_get_property (GObject * object, guint prop_id, GValue * value, GPa break; case PROP_ORDERING_INDEX: - if (priv->ordering_index == 0) { - g_value_set_uint(value, generate_id(priv->category, priv->id)); - } else { - g_value_set_uint(value, priv->ordering_index); - } + g_value_set_uint(value, priv->ordering_index); break; default: @@ -2002,12 +1998,10 @@ app_indicator_get_ordering_index (AppIndicator *self) { g_return_val_if_fail (IS_APP_INDICATOR (self), 0); - guint ordering_index = 0; - - g_object_get(G_OBJECT(self), - PROP_ORDERING_INDEX_S, &ordering_index, - NULL); - - return ordering_index; + if (self->priv->ordering_index == 0) { + return generate_id(self->priv->category, self->priv->id); + } else { + return self->priv->ordering_index; + } } -- cgit v1.2.3 From 818f7c466b1a06cea9a70e11abcfc0fba13a37c7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 11 Aug 2010 13:02:20 -0500 Subject: Putting the ordering index into the 'x' domain. --- src/app-indicator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/app-indicator.c') diff --git a/src/app-indicator.c b/src/app-indicator.c index 781b630..240e1ca 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -129,7 +129,7 @@ enum { #define PROP_CONNECTED_S "connected" #define PROP_LABEL_S "label" #define PROP_LABEL_GUIDE_S "label-guide" -#define PROP_ORDERING_INDEX_S "ordering-index" +#define PROP_ORDERING_INDEX_S "x-ayatana-ordering-index" /* Private macro, shhhh! */ #define APP_INDICATOR_GET_PRIVATE(o) \ -- cgit v1.2.3 From 9346cf3923b01a8ee557c3a0273a445962759391 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 11 Aug 2010 14:27:33 -0500 Subject: Making a wrapper property for the 'X' domain --- src/app-indicator.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'src/app-indicator.c') diff --git a/src/app-indicator.c b/src/app-indicator.c index 240e1ca..7528da2 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -115,7 +115,8 @@ enum { PROP_CONNECTED, PROP_LABEL, PROP_LABEL_GUIDE, - PROP_ORDERING_INDEX + PROP_ORDERING_INDEX, + PROP_X_ORDERING_INDEX }; /* The strings so that they can be slowly looked up. */ @@ -129,7 +130,8 @@ enum { #define PROP_CONNECTED_S "connected" #define PROP_LABEL_S "label" #define PROP_LABEL_GUIDE_S "label-guide" -#define PROP_ORDERING_INDEX_S "x-ayatana-ordering-index" +#define PROP_ORDERING_INDEX_S "ordering-index" +#define PROP_X_ORDERING_INDEX_S ("x-ayatana-" PROP_ORDERING_INDEX_S) /* Private macro, shhhh! */ #define APP_INDICATOR_GET_PRIVATE(o) \ @@ -353,6 +355,20 @@ app_indicator_class_init (AppIndicatorClass *klass) "A way to override the default ordering of the applications by providing a very specific idea of where this entry should be placed.", 0, G_MAXUINT32, 0, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + AppIndicator:x-ayatana-ordering-index: + + A wrapper for #AppIndicator:ordering-index so that it can match the + dbus interface currently. It will hopefully be retired, please don't + use it anywhere. + */ + g_object_class_install_property(object_class, + PROP_X_ORDERING_INDEX, + g_param_spec_uint (PROP_X_ORDERING_INDEX_S, + "A wrapper, please don't use.", + "A wrapper, please don't use.", + 0, G_MAXUINT32, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /* Signals */ @@ -718,6 +734,7 @@ app_indicator_set_property (GObject * object, guint prop_id, const GValue * valu } break; } + case PROP_X_ORDERING_INDEX: case PROP_ORDERING_INDEX: priv->ordering_index = g_value_get_uint(value); break; @@ -787,6 +804,7 @@ app_indicator_get_property (GObject * object, guint prop_id, GValue * value, GPa g_value_set_string (value, priv->label_guide); break; + case PROP_X_ORDERING_INDEX: case PROP_ORDERING_INDEX: g_value_set_uint(value, priv->ordering_index); break; -- cgit v1.2.3