diff options
author | Ted Gould <ted@canonical.com> | 2009-08-21 14:53:06 -0500 |
---|---|---|
committer | Ted Gould <ted@canonical.com> | 2009-08-21 14:53:06 -0500 |
commit | 10a149cf899e14f6ef5dd4be97d21f450fd8bd0f (patch) | |
tree | 8c63ff3e1e890670f8c4af0d5063f952d0f5abe1 /src | |
parent | 33e07dab3aafaf7219b3284a95ad4f16755d677d (diff) | |
download | ayatana-indicator-messages-10a149cf899e14f6ef5dd4be97d21f450fd8bd0f.tar.gz ayatana-indicator-messages-10a149cf899e14f6ef5dd4be97d21f450fd8bd0f.tar.bz2 ayatana-indicator-messages-10a149cf899e14f6ef5dd4be97d21f450fd8bd0f.zip |
Fleshing out remove to try to get rid of all these blacklist items.
Diffstat (limited to 'src')
-rw-r--r-- | src/messages-service.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/messages-service.c b/src/messages-service.c index 4e03c26..9c015e2 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -261,6 +261,14 @@ blacklist_add (gpointer udata) return FALSE; } +/* Looks through the list of definition files and + tries to match the one passed in. */ +static gboolean +blacklist_find_def (gpointer key, gpointer value, gpointer data) +{ + return !g_strcmp0((gchar *)value, (gchar *)data); +} + /* Remove a black list item based on the definition file and uneclipse those launchers blocked by it. */ static gboolean @@ -269,6 +277,31 @@ blacklist_remove (gpointer data) gchar * definition_file = (gchar *)data; g_debug("Removing: %s", definition_file); + gpointer key = g_hash_table_find(blacklist, blacklist_find_def, data); + if (key == NULL) { + g_debug("\tNot found!"); + return FALSE; + } + + GList * launcheritem; + for (launcheritem = launcherList; launcheritem != NULL; launcheritem = launcheritem->next) { + launcherList_t * li = (launcherList_t *)launcheritem->data; + if (!g_strcmp0(launcher_menu_item_get_desktop(li->menuitem), (gchar *)key)) { + GList * serveritem; + for (serveritem = serverList; serveritem != NULL; serveritem = serveritem->next) { + serverList_t * si = (serverList_t *)serveritem->data; + if (!g_strcmp0(app_menu_item_get_desktop(si->menuitem), (gchar *)key)) { + break; + } + } + if (serveritem == NULL) { + launcher_menu_item_set_eclipsed(li->menuitem, FALSE); + } + } + } + + g_hash_table_remove(blacklist, key); + return FALSE; } |