diff options
author | Ted Gould <ted@canonical.com> | 2009-08-21 16:15:16 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-08-21 16:15:16 -0500 |
commit | 286c51ca41139a2961cfe68a80a458ebf882bae9 (patch) | |
tree | 5a7cf10b46dda450010fc40f694a783108994bdf | |
parent | cb41a4d0abb8c5e06546482bf14f2c709828b625 (diff) | |
download | ayatana-indicator-messages-286c51ca41139a2961cfe68a80a458ebf882bae9.tar.gz ayatana-indicator-messages-286c51ca41139a2961cfe68a80a458ebf882bae9.tar.bz2 ayatana-indicator-messages-286c51ca41139a2961cfe68a80a458ebf882bae9.zip |
Fleshing out the first part of destroy, in that we're just removing an item from a list.
-rw-r--r-- | src/messages-service.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 41afb6b..8617c5d 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -818,6 +818,41 @@ remove_eclipses (AppMenuItem * ai) static gboolean destroy_launcher (gpointer data) { + gchar * appdirentry = (gchar *)data; + + GList * listitem; + GList * direntry; + launcherList_t * li; + gchar * appdir; + + for (listitem = launcherList; listitem != NULL; listitem = listitem->next) { + li = (launcherList_t *)listitem->data; + for (direntry = li->appdiritems; direntry != NULL; direntry = direntry->next) { + appdir = (gchar *)direntry->data; + if (!g_strcmp0(appdir, appdirentry)) { + break; + } + } + + if (direntry != NULL) { + break; + } + } + + if (listitem == NULL) { + g_warning("Removed '%s' by the way of it not seeming to exist anywhere.", appdirentry); + return FALSE; + } + + if (g_list_length(li->appdiritems) > 1) { + /* Just remove this item, and we can move on */ + g_debug("Just removing file entry: %s", appdir); + li->appdiritems = g_list_remove(li->appdiritems, appdir); + g_free(appdir); + return FALSE; + } + + /* Full Destroy */ return FALSE; } |