[PATCH] Don't fallback to home when opening an URI failed and desktop is managed by Nautilus



Reported as bug 331605 [1], proposed patch attached.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=331605

-- 
Christian Neumair <chris gnome-de org>
Index: src/nautilus-application.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-application.c,v
retrieving revision 1.238
diff -u -p -r1.238 nautilus-application.c
--- src/nautilus-application.c	9 Dec 2005 14:35:32 -0000	1.238
+++ src/nautilus-application.c	18 Feb 2006 08:41:24 -0000
@@ -154,6 +154,12 @@ nautilus_application_get_spatial_window_
 	return nautilus_application_spatial_window_list;
 }
 
+unsigned int
+nautilus_application_get_n_windows (void)
+{
+	return g_list_length (nautilus_application_window_list) +
+	       g_list_length (nautilus_application_desktop_windows);
+}
 
 static void
 nautilus_application_instance_init (NautilusApplication *application)
Index: src/nautilus-application.h
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-application.h,v
retrieving revision 1.39
diff -u -p -r1.39 nautilus-application.h
--- src/nautilus-application.h	14 Feb 2005 10:59:23 -0000	1.39
+++ src/nautilus-application.h	18 Feb 2006 08:41:24 -0000
@@ -72,6 +72,7 @@ void                 nautilus_applicatio
 							     const char          *urls[]);
 GList *              nautilus_application_get_window_list           (void);
 GList *              nautilus_application_get_spatial_window_list    (void);
+unsigned int         nautilus_application_get_n_windows            (void);
 
 NautilusWindow *     nautilus_application_present_spatial_window     (NautilusApplication *application,
 								      NautilusWindow      *requesting_window,
Index: src/nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.361
diff -u -p -r1.361 nautilus-window-manage-views.c
--- src/nautilus-window-manage-views.c	20 Dec 2005 10:00:59 -0000	1.361
+++ src/nautilus-window-manage-views.c	18 Feb 2006 08:41:25 -0000
@@ -668,14 +668,6 @@ another_navigation_window_already_showin
 	return FALSE;
 }
 
-/* utility routine that returns true if there's one or fewer windows in the window list */
-static gboolean
-just_one_window (void)
-{
-	return !eel_g_list_more_than_one_item
-                (nautilus_application_get_window_list ());
-}
-
 
 /*
  * begin_location_change
@@ -925,7 +917,9 @@ got_file_info_for_view_selection_callbac
 			 * happens when a new window cannot display its initial URI. 
 			 */
 			/* if this is the only window, we don't want to quit, so we redirect it to home */
-			if (just_one_window ()) {
+			if (nautilus_application_get_n_windows () <= 1) {
+				g_assert (nautilus_application_get_n_windows () == 1);
+
 				/* Make sure we re-use this window */
 				if (NAUTILUS_IS_SPATIAL_WINDOW (window)) {
 					NAUTILUS_SPATIAL_WINDOW (window)->affect_spatial_window_on_next_location_change = TRUE;

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil



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