Re: [Nautilus-list] XALF patch



I just found a warning I removed in the fm-directory-view.c files because of the patches (a variable stayed unused).
Then here are the changed patches again.

--
                                                         -o)
                  Remi Cohen-Scali                       /\\
<Remi Cohen-Scali com>          <rcoscali rcsnet net>    _\_v
                                                        ----


diff -u -r1.4797.2.9 nautilus/ChangeLog
--- nautilus/ChangeLog	2001/11/08 05:37:33	1.4797.2.9
+++ nautilus/ChangeLog	2002/01/26 12:11:30
@@ -1,3 +1,16 @@
+2002-01-26  Remi Cohen-Scali  <remi cohen-scali com>
+
+	* src/file-manager/fm-directory-view.c (activate_callback): 
+	Now use newly public NautilusDesktopFile class & nautilus_desktop_file_launch
+	to launch the corresponding command.
+
+	* libnautilus-private/nautilus-desktop-file-loader.c: 
+	* libnautilus-private/nautilus-desktop-file-loader.h: 
+	Made the NautilusDesktopFile class public. The struct has been moved
+	from the source to the header. The nautilus_desktop_file_new method
+	is not static any more.
+	
+
 2002-01-22  Darin Adler  <darin bentspoon com>
 
 	* libnautilus-private/nautilus-icon-container.c:
diff -u -r1.2 nautilus/libnautilus-private/nautilus-desktop-file-loader.c
--- nautilus/libnautilus-private/nautilus-desktop-file-loader.c	2001/09/26 16:37:15	1.2
+++ nautilus/libnautilus-private/nautilus-desktop-file-loader.c	2002/01/26 12:03:07
@@ -105,7 +105,6 @@
 								    NautilusDesktopFileForeachFunc   func,
 								    gpointer                         user_data);
 
-static NautilusDesktopFile *        nautilus_desktop_file_new             (void);
 static void                         hash_lines                            (NautilusDesktopFile             *df);
 static NautilusDesktopFileSection*  section_new                           (const char                      *name,
 									   char                           **start_line);
@@ -118,7 +117,7 @@
 static void                         addition_free                         (NautilusDesktopFileAddition     *addition);
 
 
-static NautilusDesktopFile*
+NautilusDesktopFile*
 nautilus_desktop_file_new (void)
 {
         NautilusDesktopFile *df;
@@ -1160,6 +1159,7 @@
 	char *url;
 	char *exec;
 	char *subst;
+	char *name;
 		
 		
 
@@ -1187,11 +1187,13 @@
 
 			in_terminal = FALSE;
 			nautilus_desktop_file_get_boolean (df, NULL, "Terminal", &in_terminal);
+			nautilus_desktop_file_get_locale_string (df, NULL, "Name", &name);
 
-			nautilus_launch_application_from_command ("",
+			nautilus_launch_application_from_command (name,
 								  subst,
 								  NULL,
 								  in_terminal);
+			g_free (name);
 			g_free (subst);
 		}
 
diff -u -r1.2 nautilus/libnautilus-private/nautilus-desktop-file-loader.h
--- nautilus/libnautilus-private/nautilus-desktop-file-loader.h	2001/09/26 16:37:15	1.2
+++ nautilus/libnautilus-private/nautilus-desktop-file-loader.h	2002/01/26 12:03:07
@@ -40,6 +40,7 @@
  * and put it in another library for use by the panel, nautilus etc.
  */
 
+NautilusDesktopFile *nautilus_desktop_file_new             (void);
 GnomeVFSResult       nautilus_desktop_file_load            (const char                      *uri,
 							    NautilusDesktopFile            **desktop_file);
 NautilusDesktopFile *nautilus_desktop_file_from_string     (const char                      *data);

diff -u -r1.473.2.3 nautilus/src/file-manager/fm-directory-view.c
--- nautilus/src/file-manager/fm-directory-view.c	2001/10/26 01:06:47	1.473.2.3
+++ nautilus/src/file-manager/fm-directory-view.c	2002/01/26 12:05:09
@@ -75,6 +75,7 @@
 #include <libnautilus-private/nautilus-trash-directory.h>
 #include <libnautilus-private/nautilus-trash-monitor.h>
 #include <libnautilus-private/nautilus-view-identifier.h>
+#include <libnautilus-private/nautilus-desktop-file-loader.h>
 #include <libnautilus/nautilus-bonobo-ui.h>
 #include <math.h>
 
@@ -4597,9 +4598,10 @@
 {
 	ActivateParameters *parameters;
 	FMDirectoryView *view;
-	char *uri, *command, *executable_path, *quoted_path, *name;
+	char *uri, *executable_path, *quoted_path, *name;
 	GnomeVFSMimeApplication *application;
 	ActivationAction action;
+	NautilusDesktopFile *df; 
 	
 	parameters = callback_data;
 
@@ -4636,8 +4638,12 @@
 			 * enforced by using a call that uses
 			 * fork/execlp instead of system.
 			 */
-			command = uri + strlen (NAUTILUS_COMMAND_SPECIFIER);
-			eel_gnome_shell_execute (command);
+			name = nautilus_file_get_uri (file); 
+			df = nautilus_desktop_file_new ();
+			nautilus_desktop_file_load (name, &df);
+			g_free (name); 
+			nautilus_desktop_file_launch (df);
+			nautilus_desktop_file_free (df);
 			action = ACTIVATION_ACTION_DO_NOTHING;
 		}
 	}
--- nautilus/ChangeLog	2001/11/08 05:37:33
+++ nautilus/ChangeLog	2002/01/26 12:11:30
@@ -1,3 +1,16 @@
+2002-01-26  Remi Cohen-Scali  <remi cohen-scali com>
+
+	* src/file-manager/fm-directory-view.c (activate_callback): 
+	Now use newly public NautilusDesktopFile class & nautilus_desktop_file_launch
+	to launch the corresponding command.
+
+	* libnautilus-private/nautilus-desktop-file-loader.c: 
+	* libnautilus-private/nautilus-desktop-file-loader.h: 
+	Made the NautilusDesktopFile class public. The struct has been moved
+	from the source to the header. The nautilus_desktop_file_new method
+	is not static any more.
+	
+
 2002-01-25  Michael Meeks  <michael ximian com>
 
 	* libnautilus-private/nautilus-bookmark.c

diff -u nautilus-orig/libnautilus-private/nautilus-desktop-file-loader.c nautilus/libnautilus-private/nautilus-desktop-file-loader.c
--- nautilus-orig/libnautilus-private/nautilus-desktop-file-loader.c	2001/09/26 16:37:15
+++ nautilus/libnautilus-private/nautilus-desktop-file-loader.c	2002/01/26 12:03:07
@@ -102,7 +102,6 @@
 								    NautilusDesktopFileForeachFunc   func,
 								    gpointer                         user_data);
 
-static NautilusDesktopFile *        nautilus_desktop_file_new             (void);
 static void                         hash_lines                            (NautilusDesktopFile             *df);
 static NautilusDesktopFileSection*  section_new                           (const char                      *name,
 									   char                           **start_line);
@@ -115,7 +114,7 @@
 static void                         addition_free                         (NautilusDesktopFileAddition     *addition);
 
 
-static NautilusDesktopFile*
+NautilusDesktopFile*
 nautilus_desktop_file_new (void)
 {
         NautilusDesktopFile *df;
@@ -1099,8 +1098,7 @@
 	char *url;
 	char *exec;
 	char *subst;
-		
-		
+	char *name;
 
 	if (!nautilus_desktop_file_get_string (df, NULL, "Type", &type)) {
 		return;
@@ -1126,11 +1124,13 @@
 
 			in_terminal = FALSE;
 			nautilus_desktop_file_get_boolean (df, NULL, "Terminal", &in_terminal);
+			nautilus_desktop_file_get_locale_string (df, NULL, "Name", &name);
 
-			nautilus_launch_application_from_command ("",
+			nautilus_launch_application_from_command (name,
 								  subst,
 								  NULL,
 								  in_terminal);
+			g_free (name);
 			g_free (subst);
 		}
 
diff -u nautilus-orig/libnautilus-private/nautilus-desktop-file-loader.h nautilus/libnautilus-private/nautilus-desktop-file-loader.h
--- nautilus-orig/libnautilus-private/nautilus-desktop-file-loader.h	2001/09/26 16:37:15
+++ nautilus/libnautilus-private/nautilus-desktop-file-loader.h	2002/01/26 12:03:07
@@ -40,6 +40,7 @@
  * and put it in another library for use by the panel, nautilus etc.
  */
 
+NautilusDesktopFile *nautilus_desktop_file_new             (void);
 GnomeVFSResult       nautilus_desktop_file_load            (const char                      *uri,
 							    NautilusDesktopFile            **desktop_file);
 NautilusDesktopFile *nautilus_desktop_file_from_string     (const char                      *data);

diff -u -r1.473.2.3 nautilus/src/file-manager/fm-directory-view.c
--- nautilus/src/file-manager/fm-directory-view.c	2001/10/26 01:06:47	1.473.2.3
+++ nautilus/src/file-manager/fm-directory-view.c	2002/01/26 12:05:09
@@ -74,6 +74,7 @@
 #include <libnautilus-private/nautilus-trash-directory.h>
 #include <libnautilus-private/nautilus-trash-monitor.h>
 #include <libnautilus-private/nautilus-view-identifier.h>
+#include <libnautilus-private/nautilus-desktop-file-loader.h>
 #include <libnautilus/nautilus-bonobo-ui.h>
 #include <math.h>
 #include <unistd.h>
@@ -4624,9 +4625,10 @@
 {
 	ActivateParameters *parameters;
 	FMDirectoryView *view;
-	char *uri, *command, *executable_path, *quoted_path, *name;
+	char *uri, *executable_path, *quoted_path, *name;
 	GnomeVFSMimeApplication *application;
 	ActivationAction action;
+	NautilusDesktopFile *df; 
 	
 	parameters = callback_data;
 
@@ -4663,8 +4665,12 @@
 			 * enforced by using a call that uses
 			 * fork/execlp instead of system.
 			 */
-			command = uri + strlen (NAUTILUS_COMMAND_SPECIFIER);
-			eel_gnome_shell_execute (command);
+			name = nautilus_file_get_uri (file); 
+			df = nautilus_desktop_file_new ();
+			nautilus_desktop_file_load (name, &df);
+			g_free (name); 
+			nautilus_desktop_file_launch (df);
+			nautilus_desktop_file_free (df);
 			action = ACTIVATION_ACTION_DO_NOTHING;
 		}
 	}


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