From a9bf19636361c1d4a912db0a4d51d21d025b4640 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 16:52:01 -0600 Subject: Implements the get_location function to place the entires. --- src/indicator-application.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/indicator-application.c b/src/indicator-application.c index 5ed7a9e..3ef5688 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -92,6 +92,7 @@ static void indicator_application_init (IndicatorApplication *self); static void indicator_application_dispose (GObject *object); static void indicator_application_finalize (GObject *object); static GList * get_entries (IndicatorObject * io); +static guint get_location (IndicatorObject * io, IndicatorObjectEntry * entry); static void connected (IndicatorServiceManager * sm, gboolean connected, IndicatorApplication * application); static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, IndicatorApplication * application); static void application_removed (DBusGProxy * proxy, gint position , IndicatorApplication * application); @@ -116,6 +117,7 @@ indicator_application_class_init (IndicatorApplicationClass *klass) IndicatorObjectClass * io_class = INDICATOR_OBJECT_CLASS(klass); io_class->get_entries = get_entries; + io_class->get_location = get_location; dbus_g_object_register_marshaller(_application_service_marshal_VOID__STRING_INT_STRING_STRING_STRING, G_TYPE_NONE, @@ -298,6 +300,15 @@ get_entries (IndicatorObject * io) return retval; } +/* Finds the location of a specific entry */ +static guint +get_location (IndicatorObject * io, IndicatorObjectEntry * entry) +{ + g_return_val_if_fail(IS_INDICATOR_APPLICATION(io), 0); + IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(io); + return g_list_index(priv->applications, entry); +} + /* Here we respond to new applications by building up the ApplicationEntry and signaling the indicator host that we've got a new indicator. */ -- cgit v1.2.3