From 463ca24ae82ecadaf319a42dc903301afa2c9b2b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 6 Nov 2009 13:38:09 -0600 Subject: Fleshing out get_entries --- src/indicator-custom.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/indicator-custom.c b/src/indicator-custom.c index d520948..f9577fb 100644 --- a/src/indicator-custom.c +++ b/src/indicator-custom.c @@ -202,11 +202,28 @@ connected (IndicatorServiceManager * sm, gboolean connected, IndicatorCustom * c return; } +/* Goes through the list of applications that we're maintaining and + pulls out the IndicatorObjectEntry and returns that in a list + for the caller. */ static GList * get_entries (IndicatorObject * io) { + g_return_val_if_fail(IS_INDICATOR_CUSTOM(io), NULL); - return NULL; + IndicatorCustomPrivate * priv = INDICATOR_CUSTOM_GET_PRIVATE(io); + GList * retval = NULL; + GList * apppointer = NULL; + + for (apppointer = priv->applications; apppointer != NULL; apppointer = g_list_next(apppointer)) { + IndicatorObjectEntry * entry = &(((ApplicationEntry *)apppointer->data)->entry); + retval = g_list_prepend(retval, entry); + } + + if (retval != NULL) { + retval = g_list_reverse(retval); + } + + return retval; } static void -- cgit v1.2.3