diff options
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/messages-service.c | 49 | ||||
-rw-r--r-- | src/status-provider-mc5.c | 6 |
3 files changed, 51 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index 4a7d1e0..3c8552c 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-messages.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-messages, 0.5.94) +AM_INIT_AUTOMAKE(indicator-messages, 0.5.95) AM_MAINTAINER_MODE diff --git a/src/messages-service.c b/src/messages-service.c index 4df5d1a..078cee3 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -321,14 +321,58 @@ desktop_file_from_keyfile (const gchar * definition_file) return desktopfile; } +/* Check if path is a symlink and return its target if it is */ +static gchar * +get_symlink_target (const gchar *path) +{ + GFile *file; + GFileInfo *fileinfo; + gchar *target = NULL; + + file = g_file_new_for_path (path); + + fileinfo = g_file_query_info (file, "standard::is-symlink", + G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS, + NULL, NULL); + g_object_unref (file); + + if (!fileinfo) + return NULL; + + if (g_file_info_get_is_symlink (fileinfo)) + target = g_strdup (g_file_info_get_symlink_target (fileinfo)); + + g_object_unref (fileinfo); + return target; +} + /* Add a definition file into the black list and eclipse any launchers that have the same file. */ static gboolean blacklist_add (gpointer udata) { gchar * definition_file = (gchar *)udata; + gchar * symlink_target = get_symlink_target (definition_file); + gchar * contents = NULL; - blacklist_add_core(definition_file, definition_file); + if (symlink_target) + { + blacklist_add_core (symlink_target, definition_file); + g_free (symlink_target); + } + else if (g_str_has_suffix (definition_file, ".desktop")) + { + blacklist_add_core(definition_file, definition_file); + } + else if (g_file_get_contents (definition_file, &contents, NULL, NULL)) + { + gchar *trimmed = pango_trim_string (contents); + blacklist_add_core (trimmed, definition_file); + g_free (trimmed); + g_free (contents); + } + else + g_warning ("invalid blacklist entry: %s", definition_file); return FALSE; } @@ -620,7 +664,7 @@ server_shortcut_added (AppMenuItem * appitem, DbusmenuMenuitem * mi, gpointer da g_debug("Application Shortcut added: %s", mi != NULL ? dbusmenu_menuitem_property_get(mi, DBUSMENU_MENUITEM_PROP_LABEL) : "none"); DbusmenuMenuitem * shell = DBUSMENU_MENUITEM(data); if (mi != NULL) { - dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_ICON_NAME, "blank-icon"); + dbusmenu_menuitem_property_set (mi, DBUSMENU_MENUITEM_PROP_ICON_NAME, DBUSMENU_MENUITEM_ICON_NAME_BLANK); dbusmenu_menuitem_child_append(shell, mi); } resort_menu(shell); @@ -1055,6 +1099,7 @@ indicator_added (IndicateListener * listener, IndicateListenerServer * server, I } else { g_warning("Unable to find server menu item"); dbusmenu_menuitem_child_append(menushell, DBUSMENU_MENUITEM(menuitem)); + resort_menu (root_menuitem); } return; diff --git a/src/status-provider-mc5.c b/src/status-provider-mc5.c index e70496c..3f23565 100644 --- a/src/status-provider-mc5.c +++ b/src/status-provider-mc5.c @@ -137,7 +137,7 @@ status_provider_mc5_init (StatusProviderMC5 *self) { StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(self); - priv->status = STATUS_PROVIDER_STATUS_DISCONNECTED; + priv->status = STATUS_PROVIDER_STATUS_OFFLINE; priv->manager = NULL; DBusGConnection * bus = dbus_g_bus_get(DBUS_BUS_SESSION, NULL); @@ -219,7 +219,7 @@ dbus_namechange (DBusGProxy * proxy, const gchar * name, const gchar * prev, con priv->manager = NULL; } - priv->status = STATUS_PROVIDER_STATUS_DISCONNECTED; + priv->status = STATUS_PROVIDER_STATUS_OFFLINE; g_signal_emit(G_OBJECT(self), STATUS_PROVIDER_SIGNAL_STATUS_CHANGED_ID, 0, priv->status, TRUE); } @@ -282,7 +282,7 @@ get_status (StatusProvider * sp) StatusProviderMC5Private * priv = STATUS_PROVIDER_MC5_GET_PRIVATE(sp); if (priv->manager == NULL) { - return STATUS_PROVIDER_STATUS_DISCONNECTED; + return STATUS_PROVIDER_STATUS_OFFLINE; } return priv->status; |