gedit r6360 - in trunk: . plugins/filebrowser



Author: jessevdk
Date: Thu Aug  7 21:29:10 2008
New Revision: 6360
URL: http://svn.gnome.org/viewvc/gedit?rev=6360&view=rev

Log:
        * plugins/filebrowser/gedit-file-browser.store.c: fixed handling
        error while loading new root directory


Modified:
   trunk/ChangeLog
   trunk/plugins/filebrowser/gedit-file-browser-store.c

Modified: trunk/plugins/filebrowser/gedit-file-browser-store.c
==============================================================================
--- trunk/plugins/filebrowser/gedit-file-browser-store.c	(original)
+++ trunk/plugins/filebrowser/gedit-file-browser-store.c	Thu Aug  7 21:29:10 2008
@@ -2510,6 +2510,34 @@
 	GCancellable * cancellable;
 } MountInfo;
 
+
+static void
+handle_root_error (GeditFileBrowserStore * model, GError *error)
+{
+	FileBrowserNode * root;
+
+	g_signal_emit (model, 
+		       model_signals[ERROR], 
+		       0, 
+		       GEDIT_FILE_BROWSER_ERROR_SET_ROOT,
+		       error->message);
+
+	g_error_free (error);
+	
+	/* Set the virtual root to the root */
+	root = model->priv->root;
+	model->priv->virtual_root = root;
+	
+	/* Set the root to be loaded */
+	root->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_LOADED;
+	
+	/* Check the dummy */
+	model_check_dummy (model, root);
+	
+	g_object_notify (G_OBJECT (model), "root");
+	g_object_notify (G_OBJECT (model), "virtual-root");
+}
+
 static void
 mount_cb (GFile * file, 
 	  GAsyncResult * res, 
@@ -2517,7 +2545,6 @@
 {
 	GFile * mounted_on;
 	GError * error = NULL;
-	FileBrowserNode * root;
 	GeditFileBrowserStore * model = mount_info->model;
 	
 	mounted_on = g_file_mount_mountable_finish (file, res, &error);
@@ -2537,26 +2564,7 @@
 	}
 	else if (error->code != G_IO_ERROR_CANCELLED)
 	{
-		g_signal_emit (model, 
-			       model_signals[ERROR], 
-			       0, 
-			       GEDIT_FILE_BROWSER_ERROR_SET_ROOT,
-			       error->message);
-
-		g_error_free (error);
-		
-		/* Set the virtual root to the root */
-		root = model->priv->root;
-		model->priv->virtual_root = root;
-		
-		/* Set the root to be loaded */
-		root->flags |= GEDIT_FILE_BROWSER_STORE_FLAG_LOADED;
-		
-		/* Check the dummy */
-		model_check_dummy (model, root);
-		
-		g_object_notify (G_OBJECT (model), "root");
-		g_object_notify (G_OBJECT (model), "virtual-root");
+		handle_root_error (model, error);
 	}
 	
 	g_object_unref (mount_info->operation);
@@ -2598,10 +2606,12 @@
 						       mount_info->cancellable,
 						       (GAsyncReadyCallback)mount_cb,
 						       mount_info);
-						
+			g_error_free (error);
+		}
+		else
+		{
+			handle_root_error (model, error);
 		}
-		
-		g_error_free (error);
 	} else {
 		g_object_unref (info);
 		



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