[PATCH] Fixed the defect 126887



Hi,

I have fixed the defect 126887. The defect is, when a user double clicks
a file on which he doesnt have read rights, it tries opening the file.
The view fails. Nautilus was not able to handle the view failure.  
Patch is listed below and also attached.

Thanks
Srini.

---PATCH-----
Index: nautilus/src//nautilus-navigation-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-navigation-window.c,v
retrieving revision 1.417
diff -p -u -r1.417 nautilus-navigation-window.c
--- nautilus/src//nautilus-navigation-window.c  3 Nov 2003 14:12:38
-0000       1.417
+++ nautilus/src//nautilus-navigation-window.c  18 Nov 2003 07:38:41
-0000
@@ -918,36 +918,20 @@ connect_view (NautilusNavigationWindow *
 }
                                                                                                                              
 static void
-disconnect_view (NautilusNavigationWindow *window, NautilusViewFrame
*view)
-{
-       if (!view) {
-               return;
-       }
-
-       g_signal_handlers_disconnect_by_func
-               (G_OBJECT (view),
-                G_CALLBACK (zoom_parameters_changed_callback),
-                window);
-       g_signal_handlers_disconnect_by_func
-               (view,
-                G_CALLBACK (zoom_level_changed_callback),
-                window);
-}
-
-static void
 real_set_content_view_widget (NautilusWindow *nautilus_window,
                              NautilusViewFrame *new_view)
 {
        NautilusNavigationWindow *window;
                                                                                                                              
        window = NAUTILUS_NAVIGATION_WINDOW (nautilus_window);
-
-       disconnect_view (window, nautilus_window->content_view);
                                                                                                                              
        EEL_CALL_PARENT (NAUTILUS_WINDOW_CLASS,
                         set_content_view_widget,
                         (nautilus_window, new_view));
-
+
+       if (new_view == NULL)   {
+               return;
+       }
        connect_view (window, new_view);
                                                                                                                                      nautilus_horizontal_splitter_pack2 (
Index: nautilus/src//nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.325
diff -p -u -r1.325 nautilus-window-manage-views.c
--- nautilus/src//nautilus-window-manage-views.c        17 Oct 2003
07:33:34 -0000      1.325
+++ nautilus/src//nautilus-window-manage-views.c        18 Nov 2003
07:38:49 -0000
@@ -1004,8 +1004,9 @@ handle_view_failure (NautilusWindow *win
         g_warning ("A view failed. The UI will handle this with a
dialog but this should be debugged.");
                                                                                                                              
         if (view == window->content_view) {
+                disconnect_view(window, window->content_view);
                 nautilus_window_set_content_view_widget (window, NULL);
-
+
                 /* FIXME bugzilla.gnome.org 45039: We need a
                  * way to report the specific error that
                  * happens in this case - adapter factory not




Index: nautilus/src//nautilus-navigation-window.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-navigation-window.c,v
retrieving revision 1.417
diff -p -u -r1.417 nautilus-navigation-window.c
--- nautilus/src//nautilus-navigation-window.c	3 Nov 2003 14:12:38 -0000	1.417
+++ nautilus/src//nautilus-navigation-window.c	18 Nov 2003 07:38:41 -0000
@@ -918,36 +918,20 @@ connect_view (NautilusNavigationWindow *
 }
 
 static void
-disconnect_view (NautilusNavigationWindow *window, NautilusViewFrame *view)
-{
-	if (!view) {
-		return;
-	}
-	
-	g_signal_handlers_disconnect_by_func 
-		(G_OBJECT (view), 
-		 G_CALLBACK (zoom_parameters_changed_callback), 
-		 window);
-	g_signal_handlers_disconnect_by_func
-		(view, 
-		 G_CALLBACK (zoom_level_changed_callback), 
-		 window);	
-}
-
-static void
 real_set_content_view_widget (NautilusWindow *nautilus_window,
 			      NautilusViewFrame *new_view)
 {
 	NautilusNavigationWindow *window;
 	
 	window = NAUTILUS_NAVIGATION_WINDOW (nautilus_window);
-	
-	disconnect_view (window, nautilus_window->content_view);
 
 	EEL_CALL_PARENT (NAUTILUS_WINDOW_CLASS, 
 			 set_content_view_widget, 
 			 (nautilus_window, new_view));
-
+	
+	if (new_view == NULL)	{
+		return;
+	}
 	connect_view (window, new_view);
 
 	nautilus_horizontal_splitter_pack2 (
Index: nautilus/src//nautilus-window-manage-views.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/nautilus-window-manage-views.c,v
retrieving revision 1.325
diff -p -u -r1.325 nautilus-window-manage-views.c
--- nautilus/src//nautilus-window-manage-views.c	17 Oct 2003 07:33:34 -0000	1.325
+++ nautilus/src//nautilus-window-manage-views.c	18 Nov 2003 07:38:49 -0000
@@ -1004,8 +1004,9 @@ handle_view_failure (NautilusWindow *win
         g_warning ("A view failed. The UI will handle this with a dialog but this should be debugged.");
 
         if (view == window->content_view) {
+                disconnect_view(window, window->content_view);			
                 nautilus_window_set_content_view_widget (window, NULL);
-                
+			
                 /* FIXME bugzilla.gnome.org 45039: We need a
                  * way to report the specific error that
                  * happens in this case - adapter factory not


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