Re: Patch : fix compilation when startup-notification isn't installed



Le jeudi 28 avril 2005 à 18:00 +0200, Frederic Crozat a écrit :
> The attached patch fixes nautilus compilation when startup-notification
> isn't installed on the system.
> 
> Permission to commit on HEAD and 2.10 branch ?

Woops, better patch (I forgot one file):


-- 
Frederic Crozat <fcrozat mandriva com>
Mandriva
? depcomp
? nautilus-folder-handler.desktop
? nautilus-sn.patch
? nautilus-sn1.patch
? stamp-h1
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.6467
diff -u -p -r1.6467 ChangeLog
--- ChangeLog	27 Apr 2005 11:52:08 -0000	1.6467
+++ ChangeLog	28 Apr 2005 16:07:23 -0000
@@ -1,3 +1,12 @@
+2005-04-28  Frederic Crozat  <fcrozat mandriva com>
+
+	* libnautilus-private/nautilus-program-choosing.c:
+	(nautilus_launch_desktop_file):
+	* src/nautilus-application.c:
+	(nautilus_application_present_spatial_window_with_selection),
+	(nautilus_application_create_navigation_window):
+	fix build when startup notification isn't installed.
+
 2005-04-27  Alexander Larsson  <alexl redhat com>
 
 	* src/file-manager/fm-desktop-icon-view.c:
Index: libnautilus-private/nautilus-program-choosing.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-program-choosing.c,v
retrieving revision 1.77
diff -u -p -r1.77 nautilus-program-choosing.c
--- libnautilus-private/nautilus-program-choosing.c	6 Feb 2005 15:48:08 -0000	1.77
+++ libnautilus-private/nautilus-program-choosing.c	28 Apr 2005 16:07:23 -0000
@@ -855,7 +855,9 @@ nautilus_launch_desktop_file (GdkScreen 
 	const GList *p;
 	int total, count;
 	char **envp;
+#ifdef HAVE_STARTUP_NOTIFICATION
 	Time timestamp;
+#endif
 
 	/* strip the leading command specifier */
 	if (eel_str_has_prefix (desktop_file_uri, NAUTILUS_DESKTOP_COMMAND_SPECIFIER)) {
@@ -946,8 +948,10 @@ nautilus_launch_desktop_file (GdkScreen 
 
 	error = NULL;
 
+#ifdef HAVE_STARTUP_NOTIFICATION
 	timestamp = slowly_and_stupidly_obtain_timestamp (GDK_WINDOW_XDISPLAY (GTK_WIDGET (parent_window)->window));
 	gnome_desktop_item_set_launch_time (ditem, timestamp);
+#endif
 	gnome_desktop_item_launch_with_env (ditem, (GList *) parameter_uris,
 					    flags, envp,
 					    &error);
Index: src/nautilus-application.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-application.c,v
retrieving revision 1.233
diff -u -p -r1.233 nautilus-application.c
--- src/nautilus-application.c	25 Mar 2005 13:47:27 -0000	1.233
+++ src/nautilus-application.c	28 Apr 2005 16:07:23 -0000
@@ -83,8 +83,10 @@
 #include <libnautilus-private/nautilus-desktop-link-monitor.h>
 #include <libnautilus-private/nautilus-directory-private.h>
 #include <bonobo-activation/bonobo-activation.h>
+#ifdef HAVE_STARTUP_NOTIFICATION
 #define SN_API_NOT_YET_FROZEN Yes_i_know_DO_IT
 #include <libsn/sn-launchee.h>
+#endif
 
 /* Needed for the is_kdesktop_present check */
 #include <gdk/gdkx.h>
@@ -984,6 +986,8 @@ nautilus_application_present_spatial_win
 									   screen);
 }
 
+#ifdef HAVE_STARTUP_NOTIFICATION
+
 static void
 sn_error_trap_push (SnDisplay *display,
                     Display   *xdisplay)
@@ -1057,6 +1061,8 @@ end_startup_notification (GtkWidget  *wi
 	sn_display_unref (sn_display);
 }
 
+#endif
+
 NautilusWindow *
 nautilus_application_present_spatial_window_with_selection (NautilusApplication *application,
 							    NautilusWindow      *requesting_window,
@@ -1083,8 +1089,10 @@ nautilus_application_present_spatial_win
 		}
 
 		if (gnome_vfs_uris_match (existing_location, location)) {
+#ifdef HAVE_STARTUP_NOTIFICATION
 			end_startup_notification (GTK_WIDGET (existing_window),
 						  startup_id);
+#endif
 
 			gtk_window_present (GTK_WINDOW (existing_window));
 			if (new_selection) {
@@ -1095,8 +1103,10 @@ nautilus_application_present_spatial_win
 	}
 
 	window = create_window (application, NAUTILUS_TYPE_SPATIAL_WINDOW, startup_id, screen);
+#ifdef HAVE_STARTUP_NOTIFICATION
 	end_startup_notification (GTK_WIDGET (window),
 				  startup_id);
+#endif
 	if (requesting_window) {
 		/* Center the window over the requesting window by default */
 		int orig_x, orig_y, orig_width, orig_height;
@@ -1139,8 +1149,10 @@ nautilus_application_create_navigation_w
 	g_return_val_if_fail (NAUTILUS_IS_APPLICATION (application), NULL);
 	
 	window = create_window (application, NAUTILUS_TYPE_NAVIGATION_WINDOW, startup_id, screen);
+#ifdef HAVE_STARTUP_NOTIFICATION
 	end_startup_notification (GTK_WIDGET (window),
 				  startup_id);
+#endif
 
 	return window;
 }


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