gedit r6307 - in trunk: . plugins/filebrowser



Author: pborelli
Date: Tue May 27 19:19:47 2008
New Revision: 6307
URL: http://svn.gnome.org/viewvc/gedit?rev=6307&view=rev

Log:
2008-05-27  Paolo Borelli  <pborelli katamail com>

	* plugins/filebrowser/gedit-file-browser-plugin.c: do not leak a GFile.



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

Modified: trunk/plugins/filebrowser/gedit-file-browser-plugin.c
==============================================================================
--- trunk/plugins/filebrowser/gedit-file-browser-plugin.c	(original)
+++ trunk/plugins/filebrowser/gedit-file-browser-plugin.c	Tue May 27 19:19:47 2008
@@ -163,10 +163,8 @@
 	gboolean bookmarks;
 	gboolean remote;
 	GConfClient * client;
-	GFile * file = NULL;
 
 	client = gconf_client_get_default ();
-
 	if (!client)
 		return;
 
@@ -192,20 +190,25 @@
 	                                NULL);
 
 	if (root != NULL && *root != '\0') {
+		GFile *file;
+
 		file = g_file_new_for_uri (root);
 
-		if (!remote && !g_file_is_native (file)) {
-		} else if (virtual_root != NULL && virtual_root != '\0') {
-			prepare_auto_root(data);
-			gedit_file_browser_widget_set_root_and_virtual_root (data->tree_widget, 
-			                                                     root,
-			                                                     virtual_root);
-		} else {
-			prepare_auto_root(data);
-			gedit_file_browser_widget_set_root (data->tree_widget,
-			                                    root,
-			                                    TRUE);
+		if (remote || g_file_is_native (file)) {
+			if (virtual_root != NULL && virtual_root != '\0') {
+				prepare_auto_root(data);
+				gedit_file_browser_widget_set_root_and_virtual_root (data->tree_widget, 
+					                                             root,
+					                                             virtual_root);
+			} else {
+				prepare_auto_root(data);
+				gedit_file_browser_widget_set_root (data->tree_widget,
+					                            root,
+					                            TRUE);
+			}
 		}
+
+		g_object_unref (file);
 	}
 
 	g_object_unref (client);
@@ -222,7 +225,6 @@
 	gchar *pattern;
 
 	client = gconf_client_get_default ();
-	
 	if (!client)
 		return;
 



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