[PATCH] Don't display authentication windows again if cancelled



Together with [1] this patch ensures that authentication windows are not
shown again if they're cancelled.

[1]
http://mail.gnome.org/archives/gnome-vfs-list/2005-October/msg00005.html

-- 
Christian Neumair <chris gnome-de org>
Index: libnautilus-private/nautilus-program-choosing.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-program-choosing.c,v
retrieving revision 1.79
diff -u -p -r1.79 nautilus-program-choosing.c
--- libnautilus-private/nautilus-program-choosing.c	12 Aug 2005 18:11:29 -0000	1.79
+++ libnautilus-private/nautilus-program-choosing.c	7 Oct 2005 18:48:10 -0000
@@ -628,6 +628,8 @@ void nautilus_launch_show_file (Nautilus
 			detail_message = g_strdup 
 				(_("Please check the spelling and try again."));
 			break;
+		case GNOME_VFS_ERROR_CANCELLED:
+			break;
 		case GNOME_VFS_OK:
 		default:
 #if NEW_MIME_COMPLETE
Index: src/nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.354
diff -u -p -r1.354 nautilus-window-manage-views.c
--- src/nautilus-window-manage-views.c	9 Jul 2005 20:09:28 -0000	1.354
+++ src/nautilus-window-manage-views.c	7 Oct 2005 18:48:15 -0000
@@ -858,7 +858,8 @@ got_file_info_for_view_selection_callbac
 	vfs_result_code = nautilus_file_get_file_info_result (file);
         if (vfs_result_code == GNOME_VFS_OK
             || vfs_result_code == GNOME_VFS_ERROR_NOT_SUPPORTED
-            || vfs_result_code == GNOME_VFS_ERROR_INVALID_URI) {
+            || vfs_result_code == GNOME_VFS_ERROR_INVALID_URI
+	    || vfs_result_code != GNOME_VFS_ERROR_CANCELLED) {
 		/* We got the information we need, now pick what view to use: */
 
 		mimetype = nautilus_file_get_mime_type (file);
@@ -1436,7 +1437,11 @@ display_view_selection_failure (Nautilus
 		detail_message = g_strdup
 			(_("Check that an SMB server is running in the local network."));
 		break;
-		
+
+	case GNOME_VFS_ERROR_CANCELLED:
+		g_free (uri_for_display);
+		return;
+
 	case GNOME_VFS_ERROR_SERVICE_NOT_AVAILABLE:
 	default:
 		error_message = g_strdup_printf (_("Nautilus cannot display \"%s\"."),
Index: src/file-manager/fm-directory-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-directory-view.c,v
retrieving revision 1.711
diff -u -p -r1.711 fm-directory-view.c
--- src/file-manager/fm-directory-view.c	27 Sep 2005 08:34:37 -0000	1.711
+++ src/file-manager/fm-directory-view.c	7 Oct 2005 18:48:15 -0000
@@ -7248,7 +7269,8 @@ activate_callback (NautilusFile *file, g
 
 	view = FM_DIRECTORY_VIEW (parameters->view);
 
-	if (!activate_check_mime_types (view, file, TRUE)) {
+	if (!activate_check_mime_types (view, file, TRUE)
+	    || nautilus_file_get_file_info_result (file) == GNOME_VFS_ERROR_CANCELLED) {
 		nautilus_file_unref (file);
 		g_free (parameters);
 		
@@ -7379,6 +7401,13 @@ activate_activation_uri_ready_callback (
 	if (nautilus_file_is_broken_symbolic_link (file)) {
 		stop_activate (parameters);
 		report_broken_symbolic_link (parameters->view, file);
+		nautilus_file_unref (parameters->file);
+		g_free (parameters);
+		return;
+	}
+
+	if (nautilus_file_get_file_info_result (file) == GNOME_VFS_ERROR_CANCELLED) {
+		stop_activate (parameters);
 		nautilus_file_unref (parameters->file);
 		g_free (parameters);
 		return;

Attachment: signature.asc
Description: This is a digitally signed message part



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