[gedit] Remove gedit_utils_location_has_file_scheme



commit fffa1cdbb56d9042c48a997ab761fcdfd5d00ada
Author: Paolo Borelli <pborelli gnome org>
Date:   Sun Jan 6 23:23:05 2013 +0100

    Remove gedit_utils_location_has_file_scheme
    
    This was now just a wrapper around the corresponding Gio method and
    since we are breaking compat we can drop it now

 docs/reference/gedit-sections.txt               |    2 --
 gedit/gedit-document.c                          |    6 +++---
 gedit/gedit-utils.c                             |   15 ++-------------
 gedit/gedit-utils.h                             |    2 --
 plugins/filebrowser/gedit-file-browser-plugin.c |    4 ++--
 plugins/snippets/snippets/manager.py            |    2 +-
 6 files changed, 8 insertions(+), 23 deletions(-)
---
diff --git a/docs/reference/gedit-sections.txt b/docs/reference/gedit-sections.txt
index afb35d4..9d07b47 100644
--- a/docs/reference/gedit-sections.txt
+++ b/docs/reference/gedit-sections.txt
@@ -499,8 +499,6 @@ gedit_metadata_manager_set
 GBOOLEAN_TO_POINTER
 GPOINTER_TO_BOOLEAN
 IS_VALID_BOOLEAN
-gedit_utils_uri_has_writable_scheme
-gedit_utils_uri_has_file_scheme
 gedit_utils_menu_position_under_widget
 gedit_utils_menu_position_under_tree_view
 gedit_gtk_button_new_with_stock_icon
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index f2d5abc..4851eef 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -1464,7 +1464,7 @@ document_loader_loaded (GeditDocumentLoader *loader,
 	/* special case creating a named new doc */
 	else if (doc->priv->create &&
 	         (error->domain == G_IO_ERROR && error->code == G_IO_ERROR_NOT_FOUND) &&
-	         (gedit_utils_location_has_file_scheme (doc->priv->location)))
+	         (g_file_has_uri_scheme (doc->priv->location, "file")))
 	{
 		reset_temp_loading_data (doc);
 
@@ -1475,7 +1475,7 @@ document_loader_loaded (GeditDocumentLoader *loader,
 
 		return;
 	}
-	
+
 	g_signal_emit (doc,
 		       document_signals[LOADED],
 		       0,
@@ -1897,7 +1897,7 @@ gedit_document_is_local (GeditDocument *doc)
 		return FALSE;
 	}
 
-	return gedit_utils_location_has_file_scheme (doc->priv->location);
+	return g_file_has_uri_scheme (doc->priv->location, "file");
 }
 
 static void
diff --git a/gedit/gedit-utils.c b/gedit/gedit-utils.c
index 8aedf69..e59230a 100644
--- a/gedit/gedit-utils.c
+++ b/gedit/gedit-utils.c
@@ -65,18 +65,6 @@
 
 #define STDIN_DELAY_MICROSECONDS 100000
 
-/**
- * gedit_utils_location_has_file_scheme:
- * @location: the location to check
- *
- * Returns: %TRUE if @location is a file: uri and is not a chained uri
- */
-gboolean
-gedit_utils_location_has_file_scheme (GFile *location)
-{
-	return g_file_has_uri_scheme (location, "file");
-}
-
 static void
 widget_get_origin (GtkWidget *widget,
 		   gint      *x,
@@ -1273,9 +1261,10 @@ gedit_utils_basename_for_display (GFile *location)
 	uri = g_file_get_uri (location);
 
 	/* First, try to query the display name, but only on local files */
-	if (gedit_utils_location_has_file_scheme (location))
+	if (g_file_has_uri_scheme (location, "file"))
 	{
 		GFileInfo *info;
+
 		info = g_file_query_info (location,
 					  G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME,
 					  G_FILE_QUERY_INFO_NONE,
diff --git a/gedit/gedit-utils.h b/gedit/gedit-utils.h
index ed647f9..1f5b1f3 100644
--- a/gedit/gedit-utils.h
+++ b/gedit/gedit-utils.h
@@ -50,8 +50,6 @@ G_BEGIN_DECLS
 
 enum { GEDIT_ALL_WORKSPACES = 0xffffffff };
 
-gboolean	 gedit_utils_location_has_file_scheme	(GFile            *location);
-
 void		 gedit_utils_menu_position_under_widget (GtkMenu          *menu,
 							 gint             *x,
 							 gint             *y,
diff --git a/plugins/filebrowser/gedit-file-browser-plugin.c b/plugins/filebrowser/gedit-file-browser-plugin.c
index 53f4ab2..0b8714f 100644
--- a/plugins/filebrowser/gedit-file-browser-plugin.c
+++ b/plugins/filebrowser/gedit-file-browser-plugin.c
@@ -521,7 +521,7 @@ on_selection_changed_cb (GtkTreeSelection       *selection,
 
 		if (location)
 		{
-			sensitive = gedit_utils_location_has_file_scheme (location);
+			sensitive = g_file_has_uri_scheme (location, "file");
 			g_object_unref (location);
 		}
 		else
@@ -1029,7 +1029,7 @@ on_tab_added_cb (GeditWindow            *window,
 
 		if (location != NULL)
 		{
-			if (gedit_utils_location_has_file_scheme (location))
+			if (g_file_has_uri_scheme (location, "file"))
 			{
 				prepare_auto_root (plugin);
 				set_root_from_doc (plugin, doc);
diff --git a/plugins/snippets/snippets/manager.py b/plugins/snippets/snippets/manager.py
index dcd1355..4eb98c7 100644
--- a/plugins/snippets/snippets/manager.py
+++ b/plugins/snippets/snippets/manager.py
@@ -744,7 +744,7 @@ class Manager(Gtk.Dialog, Gtk.Buildable):
                 success = True
 
                 for gfile in files:
-                        if not Gedit.utils_location_has_file_scheme(gfile):
+                        if not gfile.has_uri_scheme('file'):
                                 continue
 
                         # Remove file://



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