aboutsummaryrefslogtreecommitdiff
path: root/src/app-menu-item.c
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2012-05-18 23:26:54 +0200
committerLars Uebernickel <lars.uebernickel@canonical.com>2012-05-18 23:26:54 +0200
commit583033cb8dbf95d224bc9cc4bf4d4d097b7950f3 (patch)
tree073987a4df486ac56dba3c63b6b83f8f6d52c496 /src/app-menu-item.c
parente7376b8e516039cc9da5e57b1b21e4c98c69d437 (diff)
downloadayatana-indicator-messages-583033cb8dbf95d224bc9cc4bf4d4d097b7950f3.tar.gz
ayatana-indicator-messages-583033cb8dbf95d224bc9cc4bf4d4d097b7950f3.tar.bz2
ayatana-indicator-messages-583033cb8dbf95d224bc9cc4bf4d4d097b7950f3.zip
Remove default applications
This gets rid of the "Set Up <app>" sections for Email, Chat, and Broadcast. Also, default apps don't get to override the icon and names anymore. Every app gets its real name and icon displayed. Overriding the icon with X-Ayatana-Messaging-Menu-Icon is still possible.
Diffstat (limited to 'src/app-menu-item.c')
-rw-r--r--src/app-menu-item.c48
1 files changed, 19 insertions, 29 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c
index ef3fbc0..3fb3ab8 100644
--- a/src/app-menu-item.c
+++ b/src/app-menu-item.c
@@ -30,7 +30,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libdbusmenu-glib/menuitem-proxy.h>
#include "app-menu-item.h"
#include "dbus-data.h"
-#include "default-applications.h"
#include "seen-db.h"
enum {
@@ -257,11 +256,7 @@ static void
update_label (AppMenuItem * self)
{
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
- const gchar * name = get_default_name(priv->desktop);
-
- if (name == NULL) {
- name = app_menu_item_get_name(self);
- }
+ const gchar * name = app_menu_item_get_name(self);
if (priv->unreadcount > 0) {
/* TRANSLATORS: This is the name of the program and the number of indicators. So it
@@ -345,36 +340,31 @@ desktop_cb (IndicateListener * listener, IndicateListenerServer * server, const
update_label(self);
- const gchar * def_icon = get_default_icon(priv->desktop);
- if (def_icon == NULL) {
- gchar * iconstr = NULL;
+ gchar * iconstr = NULL;
- /* Check for the over ride key and see if we should be using that
- icon. If we can't get it, then go back to the app info */
- if (g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, ICON_KEY, NULL) && iconstr == NULL) {
- GError * error = NULL;
+ /* Check for the over ride key and see if we should be using that
+ icon. If we can't get it, then go back to the app info */
+ if (g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, ICON_KEY, NULL) && iconstr == NULL) {
+ GError * error = NULL;
- iconstr = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, ICON_KEY, &error);
-
- if (error != NULL) {
- /* Can't figure out why this would happen, but sure, let's print something */
- g_warning("Error getting '" ICON_KEY "' from desktop file: %s", error->message);
- g_error_free(error);
- }
- }
+ iconstr = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, ICON_KEY, &error);
- /* For some reason that didn't work, let's try the app info */
- if (iconstr == NULL) {
- GIcon * icon = g_app_info_get_icon(priv->appinfo);
- iconstr = g_icon_to_string(icon);
+ if (error != NULL) {
+ /* Can't figure out why this would happen, but sure, let's print something */
+ g_warning("Error getting '" ICON_KEY "' from desktop file: %s", error->message);
+ g_error_free(error);
}
+ }
- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_ICON, iconstr);
- g_free(iconstr);
- } else {
- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_ICON, def_icon);
+ /* For some reason that didn't work, let's try the app info */
+ if (iconstr == NULL) {
+ GIcon * icon = g_app_info_get_icon(priv->appinfo);
+ iconstr = g_icon_to_string(icon);
}
+ dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_ICON, iconstr);
+ g_free(iconstr);
+
g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, app_menu_item_get_name(self), TRUE);
return;