[gedit] Kill another util that these days is just an alias for a gio function



commit 37b156b51486bd2d4190c1c6cfcf47cd10f02355
Author: Paolo Borelli <pborelli gnome org>
Date:   Tue Jul 6 23:28:35 2010 +0200

    Kill another util that these days is just an alias for a gio function

 gedit/gedit-document.c          |    2 +-
 gedit/gedit-io-error-info-bar.c |   16 ++++++++--------
 gedit/gedit-tab.c               |    4 +---
 gedit/gedit-utils.c             |   17 -----------------
 gedit/gedit-utils.h             |    1 -
 gedit/gedit-window.c            |    2 +-
 6 files changed, 11 insertions(+), 31 deletions(-)
---
diff --git a/gedit/gedit-document.c b/gedit/gedit-document.c
index d1f0bf3..243c841 100644
--- a/gedit/gedit-document.c
+++ b/gedit/gedit-document.c
@@ -1242,7 +1242,7 @@ gedit_document_get_uri_for_display (GeditDocument *doc)
 	}
 	else
 	{
-		return gedit_utils_uri_for_display (doc->priv->location);
+		return g_file_get_parse_name (doc->priv->location);
 	}
 }
 
diff --git a/gedit/gedit-io-error-info-bar.c b/gedit/gedit-io-error-info-bar.c
index 0700a8b..bd5c347 100644
--- a/gedit/gedit-io-error-info-bar.c
+++ b/gedit/gedit-io-error-info-bar.c
@@ -399,7 +399,7 @@ gedit_unrecoverable_reverting_error_info_bar_new (GFile        *location,
 	g_return_val_if_fail ((error->domain == GEDIT_DOCUMENT_ERROR) || 
 			      (error->domain == G_IO_ERROR), NULL);
 
-	full_formatted_uri = gedit_utils_uri_for_display (location);
+	full_formatted_uri = g_file_get_parse_name (location);
 
 	/* Truncate the URI so it doesn't get insanely wide. Note that even
 	 * though the dialog uses wrapped text, if the URI doesn't contain
@@ -584,7 +584,7 @@ gedit_io_loading_error_info_bar_new (GFile               *location,
 
 	if (location)
 	{
-		full_formatted_uri = gedit_utils_uri_for_display (location);
+		full_formatted_uri = g_file_get_parse_name (location);
 	}
 	else
 	{
@@ -698,7 +698,7 @@ gedit_conversion_error_while_saving_info_bar_new (GFile               *location,
 	                      error->domain == G_IO_ERROR, NULL);
 	g_return_val_if_fail (encoding != NULL, NULL);
 	
-	full_formatted_uri = gedit_utils_uri_for_display (location);
+	full_formatted_uri = g_file_get_parse_name (location);
 
 	/* Truncate the URI so it doesn't get insanely wide. Note that even
 	 * though the dialog uses wrapped text, if the URI doesn't contain
@@ -766,7 +766,7 @@ gedit_file_already_open_warning_info_bar_new (GFile *location)
 
 	g_return_val_if_fail (G_IS_FILE (location), NULL);
 
-	full_formatted_uri = gedit_utils_uri_for_display (location);
+	full_formatted_uri = g_file_get_parse_name (location);
 
 	/* Truncate the URI so it doesn't get insanely wide. Note that even
 	 * though the dialog uses wrapped text, if the URI doesn't contain
@@ -858,7 +858,7 @@ gedit_externally_modified_saving_error_info_bar_new (GFile        *location,
 	g_return_val_if_fail (error->domain == GEDIT_DOCUMENT_ERROR, NULL);
 	g_return_val_if_fail (error->code == GEDIT_DOCUMENT_ERROR_EXTERNALLY_MODIFIED, NULL);
 
-	full_formatted_uri = gedit_utils_uri_for_display (location);
+	full_formatted_uri = g_file_get_parse_name (location);
 
 	/* Truncate the URI so it doesn't get insanely wide. Note that even
 	 * though the dialog uses wrapped text, if the URI doesn't contain
@@ -956,7 +956,7 @@ gedit_no_backup_saving_error_info_bar_new (GFile        *location,
 			       (error->domain == G_IO_ERROR &&
 			        error->code == G_IO_ERROR_CANT_CREATE_BACKUP)), NULL);
 
-	full_formatted_uri = gedit_utils_uri_for_display (location);
+	full_formatted_uri = g_file_get_parse_name (location);
 
 	/* Truncate the URI so it doesn't get insanely wide. Note that even
 	 * though the dialog uses wrapped text, if the URI doesn't contain
@@ -1059,7 +1059,7 @@ gedit_unrecoverable_saving_error_info_bar_new (GFile        *location,
 	g_return_val_if_fail ((error->domain == GEDIT_DOCUMENT_ERROR) || 
 			      (error->domain == G_IO_ERROR), NULL);
 
-	full_formatted_uri = gedit_utils_uri_for_display (location);
+	full_formatted_uri = g_file_get_parse_name (location);
 
 	/* Truncate the URI so it doesn't get insanely wide. Note that even
 	 * though the dialog uses wrapped text, if the URI doesn't contain
@@ -1177,7 +1177,7 @@ gedit_externally_modified_info_bar_new (GFile    *location,
 
 	g_return_val_if_fail (G_IS_FILE (location), NULL);
 
-	full_formatted_uri = gedit_utils_uri_for_display (location);
+	full_formatted_uri = g_file_get_parse_name (location);
 
 	/* Truncate the URI so it doesn't get insanely wide. Note that even
 	 * though the dialog uses wrapped text, if the URI doesn't contain
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index 6186d43..e99ba52 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -821,9 +821,7 @@ show_saving_info_bar (GeditTab *tab)
 		gchar *str;
 
 		from = short_name;
-
-		to = gedit_utils_uri_for_display (tab->priv->tmp_save_location);
-
+		to = g_file_get_parse_name (tab->priv->tmp_save_location);
 		str = gedit_utils_str_middle_truncate (to, 
 						       MAX (20, MAX_MSG_LENGTH - len));
 		g_free (to);
diff --git a/gedit/gedit-utils.c b/gedit/gedit-utils.c
index 24f7559..beece59 100644
--- a/gedit/gedit-utils.c
+++ b/gedit/gedit-utils.c
@@ -1311,23 +1311,6 @@ gedit_utils_basename_for_display (GFile *location)
 }
 
 /**
- * gedit_utils_uri_for_display:
- * @location: location to be displayed.
- *
- * Filter, modify, unescape and change @uri to make it appropriate
- * for display to users.
- * 
- * This function is a convenient wrapper for g_file_get_parse_name
- *
- * Return value: a string which represents @uri and can be displayed.
- */
-gchar *
-gedit_utils_uri_for_display (GFile *location)
-{
-	return g_file_get_parse_name (location);
-}
-
-/**
  * gedit_utils_drop_get_uris:
  * @selection_data: the #GtkSelectionData from drag_data_received
  *
diff --git a/gedit/gedit-utils.h b/gedit/gedit-utils.h
index b6e9ae9..8a6853d 100644
--- a/gedit/gedit-utils.h
+++ b/gedit/gedit-utils.h
@@ -137,7 +137,6 @@ gboolean	 gedit_utils_get_ui_objects		(const gchar      *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);
 gboolean	 gedit_utils_decode_uri 		(const gchar      *uri,
 							 gchar           **scheme,
diff --git a/gedit/gedit-window.c b/gedit/gedit-window.c
index 60656dd..f7632fd 100644
--- a/gedit/gedit-window.c
+++ b/gedit/gedit-window.c
@@ -1466,7 +1466,7 @@ update_recent_files_menu (GeditWindow *window)
 		/* gtk_recent_info_get_uri_display (info) is buggy and
 		 * works only for local files */
 		location = g_file_new_for_uri (gtk_recent_info_get_uri (info));
-		uri = gedit_utils_uri_for_display (location);
+		uri = g_file_get_parse_name (location);
 		g_object_unref (location);
 		ruri = gedit_utils_replace_home_dir_with_tilde (uri);
 		g_free (uri);



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