From df59e335f062e861c5381fc95db04ad1dfe7bb5b Mon Sep 17 00:00:00 2001
From: Benedikt Meurer <benny@xfce.org>
Date: Sun, 6 Aug 2006 20:38:25 +0000
Subject: [PATCH] 2006-08-06	Benedikt Meurer <benny@xfce.org>

	* thunar/thunar-launcher.c(thunar_launcher_update): Place additional
	  "Open With" action into a submenu if either more than 2 are available
	  or the default action for the file is "Execute".




(Old svn revision: 22677)
---
 ChangeLog                | 6 ++++++
 thunar/thunar-launcher.c | 6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c0b5e230e..7c6b3d534 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-06	Benedikt Meurer <benny@xfce.org>
+
+	* thunar/thunar-launcher.c(thunar_launcher_update): Place additional
+	  "Open With" action into a submenu if either more than 2 are available
+	  or the default action for the file is "Execute".
+
 2006-08-06	Benedikt Meurer <benny@xfce.org>
 
 	* thunar-vfs/thunar-vfs-thumb.c
diff --git a/thunar/thunar-launcher.c b/thunar/thunar-launcher.c
index 20d38385c..52c85161e 100644
--- a/thunar/thunar-launcher.c
+++ b/thunar/thunar-launcher.c
@@ -876,8 +876,10 @@ thunar_launcher_update (ThunarLauncher *launcher)
                         NULL);
         }
 
-      /* place the other applications in the "Open With" submenu if we have more than 2 other applications */
-      if (G_UNLIKELY (g_list_length (applications) > 3))
+      /* place the other applications in the "Open With" submenu if we have more than 2 other applications, or the
+       * default action for the file is "Execute", in which case the "Open With" actions aren't that relevant either
+       */
+      if (G_UNLIKELY (g_list_length (applications) > 2 || n_executables == n_selected_files))
         {
           /* determine the base paths for the actions */
           file_menu_path = "/main-menu/file-menu/placeholder-launcher/open-with-menu/placeholder-applications";
-- 
GitLab