[gedit] Remove util function now available in gio



commit 4a6738846d069420c934caf5f09d248a4567fb0b
Author: Paolo Borelli <pborelli gnome org>
Date:   Tue Jul 6 21:50:49 2010 +0200

    Remove util function now available in gio

 gedit/gedit-utils.c                             |   25 +---------------------
 gedit/gedit-utils.h                             |    8 ++----
 plugins/filebrowser/gedit-file-browser-widget.c |    3 +-
 3 files changed, 7 insertions(+), 29 deletions(-)
---
diff --git a/gedit/gedit-utils.c b/gedit/gedit-utils.c
index c475cfa..1f53b09 100644
--- a/gedit/gedit-utils.c
+++ b/gedit/gedit-utils.c
@@ -1253,28 +1253,6 @@ gedit_utils_make_canonical_uri_from_shell_arg (const gchar *str)
 }
 
 /**
- * gedit_utils_file_has_parent:
- * @gfile: the GFile to check the parent for
- *
- * Return %TRUE if the specified gfile has a parent (is not the root), %FALSE
- * otherwise
- */
-gboolean
-gedit_utils_file_has_parent (GFile *gfile)
-{
-	GFile *parent;
-	gboolean ret;
-	
-	parent = g_file_get_parent (gfile);
-	ret = parent != NULL;
-	
-	if (parent)
-		g_object_unref (parent);
-	
-	return ret;
-}
-
-/**
  * gedit_utils_basename_for_display:
  * @location: location for which the basename should be displayed
  *
@@ -1318,7 +1296,8 @@ gedit_utils_basename_for_display (GFile *location)
 			g_free (local_path);
 		}
 	}
-	else if (gedit_utils_file_has_parent (location) || !gedit_utils_decode_uri (uri, NULL, NULL, &hn, NULL, NULL))
+	else if (g_file_has_parent (location, NULL) ||
+	          !gedit_utils_decode_uri (uri, NULL, NULL, &hn, NULL, NULL))
 	{
 		/* For remote files with a parent (so not just http://foo.com)
 		   or remote file for which the decoding of the host name fails,
diff --git a/gedit/gedit-utils.h b/gedit/gedit-utils.h
index 8ea105e..af8fbe9 100644
--- a/gedit/gedit-utils.h
+++ b/gedit/gedit-utils.h
@@ -132,19 +132,17 @@ void		 gedit_utils_activate_url		(GtkAboutDialog   *about,
 gboolean	 gedit_utils_is_valid_location		(GFile            *location);
 
 gboolean	 gedit_utils_get_ui_objects		(const gchar      *filename,
-                                                         gchar           **root_objects,
+							 gchar           **root_objects,
 							 GtkWidget       **error_widget,
 							 const gchar      *object_name,
 							 ...) G_GNUC_NULL_TERMINATED;
 
-gboolean         gedit_utils_file_has_parent            (GFile            *gfile);
-
 /* Return NULL if str is not a valid URI and/or filename */
 gchar		*gedit_utils_make_canonical_uri_from_shell_arg
 							(const gchar      *str);
 		
 gchar		*gedit_utils_uri_for_display 	        (GFile            *location);
-gchar           *gedit_utils_basename_for_display	(GFile            *location);
+gchar		*gedit_utils_basename_for_display	(GFile            *location);
 gboolean	 gedit_utils_decode_uri 		(const gchar      *uri,
 							 gchar           **scheme,
 							 gchar           **user,
@@ -154,7 +152,7 @@ gboolean	 gedit_utils_decode_uri 		(const gchar      *uri,
 
 
 /* Turns data from a drop into a list of well formatted uris */
-gchar 	       **gedit_utils_drop_get_uris		(GtkSelectionData *selection_data);
+gchar		**gedit_utils_drop_get_uris		(GtkSelectionData *selection_data);
 
 gboolean	 gedit_utils_can_read_from_stdin	(void);
 
diff --git a/plugins/filebrowser/gedit-file-browser-widget.c b/plugins/filebrowser/gedit-file-browser-widget.c
index ed44e84..d7d8efd 100644
--- a/plugins/filebrowser/gedit-file-browser-widget.c
+++ b/plugins/filebrowser/gedit-file-browser-widget.c
@@ -688,7 +688,8 @@ insert_location_path (GeditFileBrowserWidget *obj)
 							   obj);
 		}
 
-		if (g_file_equal (current, loc->root) || !gedit_utils_file_has_parent (current))
+		if (g_file_equal (current, loc->root) ||
+		    !g_file_has_parent (current, NULL))
 		{
 			if (current != loc->virtual_root)
 				g_object_unref (current);



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