aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-08-29 23:14:54 +0800
committerMilan Crha <mcrha@redhat.com>2013-08-29 23:14:54 +0800
commit708c5f2e8d49c73d17cd394aff8c8a640ab97422 (patch)
tree7bd66478b2fa7e5fd6188b081671a09cd4652727
parentb4870d386c9d7e449b19a3af4972229d52febec5 (diff)
downloadgsoc2013-evolution-708c5f2e8d49c73d17cd394aff8c8a640ab97422.tar
gsoc2013-evolution-708c5f2e8d49c73d17cd394aff8c8a640ab97422.tar.gz
gsoc2013-evolution-708c5f2e8d49c73d17cd394aff8c8a640ab97422.tar.bz2
gsoc2013-evolution-708c5f2e8d49c73d17cd394aff8c8a640ab97422.tar.lz
gsoc2013-evolution-708c5f2e8d49c73d17cd394aff8c8a640ab97422.tar.xz
gsoc2013-evolution-708c5f2e8d49c73d17cd394aff8c8a640ab97422.tar.zst
gsoc2013-evolution-708c5f2e8d49c73d17cd394aff8c8a640ab97422.zip
Skip evolution from 'Open with' list of applications on attachments
-rw-r--r--e-util/e-attachment-view.c26
1 files changed, 26 insertions, 0 deletions
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);