From 708c5f2e8d49c73d17cd394aff8c8a640ab97422 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 29 Aug 2013 17:14:54 +0200 Subject: Skip evolution from 'Open with' list of applications on attachments --- e-util/e-attachment-view.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'e-util/e-attachment-view.c') diff --git a/e-util/e-attachment-view.c b/e-util/e-attachment-view.c index 2d6e090dd1..994f7ba2e1 100644 --- a/e-util/e-attachment-view.c +++ b/e-util/e-attachment-view.c @@ -661,6 +661,27 @@ attachment_view_uris (EAttachmentView *view, gtk_drag_finish (drag_context, TRUE, FALSE, time); } +static gboolean +executable_is_evolution (const gchar *app_executable) +{ + const gchar *dash; + const gchar *evo_name; + + g_return_val_if_fail (app_executable != NULL, FALSE); + + dash = strrchr (app_executable, G_DIR_SEPARATOR); + if (dash) + app_executable = dash + 1; + + #ifdef G_OS_WIN32 + evo_name = "evolution.exe"; + #else + evo_name = "evolution"; + #endif + + return g_ascii_strcasecmp (app_executable, evo_name) == 0; +} + static void attachment_view_update_actions (EAttachmentView *view) { @@ -770,6 +791,11 @@ attachment_view_update_actions (EAttachmentView *view) gchar *action_name; app_executable = g_app_info_get_executable (app_info); + + /* skip evolution from the list */ + if (executable_is_evolution (app_executable)) + continue; + app_icon = g_app_info_get_icon (app_info); app_name = g_app_info_get_name (app_info); -- cgit v1.2.3