[evolution] Skip evolution from 'Open with' list of applications on attachments



commit 708c5f2e8d49c73d17cd394aff8c8a640ab97422
Author: Milan Crha <mcrha redhat com>
Date:   Thu Aug 29 17:14:54 2013 +0200

    Skip evolution from 'Open with' list of applications on attachments

 e-util/e-attachment-view.c |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-attachment-view.c b/e-util/e-attachment-view.c
index 2d6e090..994f7ba 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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]