Re: PATCH: even better run dialog



This also requires the following gnome-desktop-item patch.

- Frank
Index: libgnome-desktop/gnome-desktop-item.c
===================================================================
RCS file: /cvs/gnome/gnome-desktop/libgnome-desktop/gnome-desktop-item.c,v
retrieving revision 1.109
diff -u -p -r1.109 gnome-desktop-item.c
--- libgnome-desktop/gnome-desktop-item.c	12 Jul 2002 03:45:09 -0000	1.109
+++ libgnome-desktop/gnome-desktop-item.c	20 Jul 2002 02:45:05 -0000
@@ -1478,7 +1478,8 @@ ditem_execute (const GnomeDesktopItem *i
                char **envp,
 	       gboolean launch_only_one,
 	       gboolean use_current_dir,
-		 gboolean append_uris,
+	       gboolean append_uris,
+	       gboolean append_paths,
 	       GError **error)
 {
 	char **real_argv;
@@ -1532,6 +1533,16 @@ ditem_execute (const GnomeDesktopItem *i
 			added_status = ADDED_ALL;
 		}
 
+		/* append_uris and append_paths are mutually exlusive */
+		if (launched == 0 && added_status == ADDED_NONE && append_paths) {
+			uris = stringify_files (args, FALSE, FALSE);
+			temp = g_strconcat (new_exec, " ", uris, NULL);
+			g_free (uris);
+			g_free (new_exec);
+			new_exec = temp;
+			added_status = ADDED_ALL;
+		}
+
 		if (launched > 0 && added_status == ADDED_NONE) {
 			g_free (new_exec);
 			break;
@@ -1649,7 +1660,7 @@ gnome_desktop_item_launch (const GnomeDe
 }
 
 /**
- * gnome_desktop_item_launch_wth_env:
+ * gnome_desktop_item_launch_with_env:
  * @item: A desktop item
  * @file_list:  Files/URIs to launch this item with, can be %NULL
  * @flags: FIXME
@@ -1736,6 +1747,7 @@ gnome_desktop_item_launch_with_env (cons
 			     (flags & GNOME_DESKTOP_ITEM_LAUNCH_ONLY_ONE),
 			     (flags & GNOME_DESKTOP_ITEM_LAUNCH_USE_CURRENT_DIR),
 			     (flags & GNOME_DESKTOP_ITEM_LAUNCH_APPEND_URIS),
+			     (flags & GNOME_DESKTOP_ITEM_LAUNCH_APPEND_PATHS),
 			     error);
 
 	return ret;
Index: libgnome-desktop/gnome-desktop-item.h
===================================================================
RCS file: /cvs/gnome/gnome-desktop/libgnome-desktop/gnome-desktop-item.h,v
retrieving revision 1.45
diff -u -p -r1.45 gnome-desktop-item.h
--- libgnome-desktop/gnome-desktop-item.h	12 Jul 2002 03:45:09 -0000	1.45
+++ libgnome-desktop/gnome-desktop-item.h	20 Jul 2002 02:45:05 -0000
@@ -118,7 +118,9 @@ typedef enum {
 	/* Append the list of URIs to the command if no Exec
 	 * parameter is specified, instead of launching the 
 	 * app without parameters. */
-	  GNOME_DESKTOP_ITEM_LAUNCH_APPEND_URIS = 1<<2
+	GNOME_DESKTOP_ITEM_LAUNCH_APPEND_URIS = 1<<2,
+	/* Same as above but instead append local paths */
+	GNOME_DESKTOP_ITEM_LAUNCH_APPEND_PATHS = 1<<3
 } GnomeDesktopItemLaunchFlags;
 
 typedef enum {


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