[PATCH] stop directory from opening after canceling authentication dialog



Steps to reproduce:
1. have the Desktop on and don't have any non-Desktop nautilus windows open
2. type ctrl-l on the Desktop and enter in "ftp://ftp.debian.org"; to the
location dialog
3. click "Cancel" on the authentication dialog that comes up

Results:
You get the normal "Can't Display Location" dialog, but you also get an
unwanted Home directory that pops up.

Attached is a patch which seems to fix it, although there may be a
better way of handling this particular situation.
Index: src/nautilus-application.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-application.c,v
retrieving revision 1.227
diff -u -r1.227 nautilus-application.c
--- src/nautilus-application.c	22 Nov 2004 15:24:37 -0000	1.227
+++ src/nautilus-application.c	1 Dec 2004 23:13:00 -0000
@@ -774,6 +774,12 @@
 	}
 }
 
+gboolean
+nautilus_application_desktop_is_shown (void)
+{
+	return ((nautilus_application_desktop_windows != NULL) ? TRUE : FALSE);
+}
+
 void
 nautilus_application_close_all_navigation_windows (void)
 {
Index: src/nautilus-application.h
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-application.h,v
retrieving revision 1.38
diff -u -r1.38 nautilus-application.h
--- src/nautilus-application.h	18 Oct 2004 21:36:11 -0000	1.38
+++ src/nautilus-application.h	1 Dec 2004 23:13:00 -0000
@@ -90,5 +90,6 @@
 void                 nautilus_application_close_all_spatial_windows  (void);
 void                 nautilus_application_open_desktop      (NautilusApplication *application);
 void                 nautilus_application_close_desktop     (void);
+gboolean             nautilus_application_desktop_is_shown  (void);
 
 #endif /* NAUTILUS_APPLICATION_H */
Index: src/nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.346
diff -u -r1.346 nautilus-window-manage-views.c
--- src/nautilus-window-manage-views.c	22 Nov 2004 15:24:37 -0000	1.346
+++ src/nautilus-window-manage-views.c	1 Dec 2004 23:13:00 -0000
@@ -893,7 +893,7 @@
 			 * 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 (just_one_window () && !nautilus_application_desktop_is_shown ()) {
 				/* 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;


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