gthumb r2215 - in trunk: . libgthumb src



Author: mjc
Date: Wed Jan 23 15:24:42 2008
New Revision: 2215
URL: http://svn.gnome.org/viewvc/gthumb?rev=2215&view=rev

Log:
2008-01-23  Michael J. Chudobiak  <mjc svn gnome org>

        * libgthumb/file-utils.h:
        * libgthumb/file-utils.c: Added get_utf8_display_name_from_uri
        as an enhanced wrapper for gnome_vfs_unescape_string_for_display,
        to partly fix bug 489922, and to simplify the eventual migration
        from gnome-vfs to gvfs/gio/Gfile.

        * libgthumb/bookmarks.c: (get_menu_item_tip):
        * libgthumb/file-data.c: (file_data_new), (file_data_update),
        (file_data_update_info):
        * libgthumb/file-utils.c: (get_utf8_display_name_from_uri),
        (get_uri_display_name), (basename_for_display),
        (delete_catalog_dir):
        * libgthumb/file-utils.h:
        * libgthumb/gtk-utils.c: (_gtk_entry_set_filename_text),
        (_gtk_label_set_filename_text):
        * src/catalog-list.c: (catalog_list_refresh):
        * src/catalog-png-exporter.c: (set_item_caption), (begin_page):
        * src/dlg-duplicates.c: (images_selection_changed_cb):
        * src/dlg-file-utils.c: (dlg_check_folder), (set_filename_labels),
        (dlg_overwrite__response_cb), (dlg_overwrite_run):
        * src/dlg-photo-importer.c: (ok_clicked_cb):
        * src/dlg-rename-series.c: (update_list), (dlg_rename_series):
        * src/dlg-scripts.c: (exec_shell_script):
        * src/dlg-web-exporter.c: (add_theme_dir):
        * src/gth-browser-actions-callbacks.c: (duplicate_file),
        (catalog_rename),
        (gth_browser_activate_action_edit_current_catalog_new),
        (create_new_folder_or_library), (folder_rename),
        (folder_copy__response_cb):
        * src/gth-browser.c: (window_update_infobar),
        (window_update_title), (dir_list_done_cb):
        * src/gth-dir-list.c: (gth_dir_list_update_view),
        (gth_dir_list_add_directory):
        * src/gth-exif-data-viewer.c: (update_file_info):
        * src/gth-fullscreen.c: (escape_filename):
        * src/gth-location.c: (update_uri):

        Replaced gnome_vfs_unescape_string_for_display with
        get_utf8_display_name_from_uri.



Modified:
   trunk/ChangeLog
   trunk/libgthumb/bookmarks.c
   trunk/libgthumb/file-data.c
   trunk/libgthumb/file-utils.c
   trunk/libgthumb/file-utils.h
   trunk/libgthumb/gtk-utils.c
   trunk/src/catalog-list.c
   trunk/src/catalog-png-exporter.c
   trunk/src/dlg-duplicates.c
   trunk/src/dlg-file-utils.c
   trunk/src/dlg-photo-importer.c
   trunk/src/dlg-rename-series.c
   trunk/src/dlg-scripts.c
   trunk/src/dlg-web-exporter.c
   trunk/src/gth-browser-actions-callbacks.c
   trunk/src/gth-browser.c
   trunk/src/gth-dir-list.c
   trunk/src/gth-exif-data-viewer.c
   trunk/src/gth-fullscreen.c
   trunk/src/gth-location.c

Modified: trunk/libgthumb/bookmarks.c
==============================================================================
--- trunk/libgthumb/bookmarks.c	(original)
+++ trunk/libgthumb/bookmarks.c	Wed Jan 23 15:24:42 2008
@@ -106,7 +106,7 @@
 	char *tmp_path;
 	char *tip;
 
-	tmp_path = gnome_vfs_unescape_string_for_display (path);
+	tmp_path = get_utf8_display_name_from_uri (path);
 
 	if (uri_scheme_is_catalog (tmp_path) || uri_scheme_is_search (tmp_path)) {
 		char *rc_dir_prefix;

Modified: trunk/libgthumb/file-data.c
==============================================================================
--- trunk/libgthumb/file-data.c	(original)
+++ trunk/libgthumb/file-data.c	Wed Jan 23 15:24:42 2008
@@ -59,7 +59,7 @@
 	fd->ref = 1;
 	fd->path = add_scheme_if_absent (path);
 	fd->name = file_name_from_path (fd->path);
-	fd->display_name = gnome_vfs_unescape_string_for_display (fd->name);
+	fd->display_name = get_utf8_display_name_from_uri (fd->name);
 	if (info != NULL) {
 		if (info->valid_fields | GNOME_VFS_FILE_INFO_FIELDS_SIZE)
 			fd->size = info->size;
@@ -203,7 +203,7 @@
 	fd->name = file_name_from_path (fd->path);
 
 	g_free (fd->display_name);
-	fd->display_name = gnome_vfs_unescape_string_for_display (fd->name);
+	fd->display_name = get_utf8_display_name_from_uri (fd->name);
 
 	fd->mime_type = get_static_string (info->mime_type);
 	fd->size = info->size;
@@ -258,7 +258,7 @@
 	fd->name = file_name_from_path (fd->path);
 
 	g_free (fd->display_name);
-	fd->display_name = gnome_vfs_unescape_string_for_display (fd->name);
+	fd->display_name = get_utf8_display_name_from_uri (fd->name);
 
 	fd->size = info->size;
 	fd->mtime = info->mtime;

Modified: trunk/libgthumb/file-utils.c
==============================================================================
--- trunk/libgthumb/file-utils.c	(original)
+++ trunk/libgthumb/file-utils.c	Wed Jan 23 15:24:42 2008
@@ -1239,6 +1239,31 @@
 /* URI/Path utils */
 
 
+char *
+get_utf8_display_name_from_uri (const char *escaped_uri)
+{
+	char        *unescaped_name = NULL;
+	char        *utf8_name = NULL;
+	GError      *err = NULL;
+
+	unescaped_name = gnome_vfs_unescape_string_for_display (escaped_uri);
+	utf8_name = g_filename_to_utf8 (unescaped_name, -1, NULL, NULL, &err);
+
+	if (err != NULL) {
+		g_warning ("%s:%u:%s(): %s\n", __FILE__, __LINE__, __FUNCTION__, err->message);
+		g_warning ("Hint: try to set G_FILENAME_ENCODING environment variable to the correct filename encoding or G_BROKEN_FILENAMES to 1\n");
+		utf8_name = unescaped_name;
+	} else {
+		g_free (unescaped_name);
+	}
+
+	if (g_utf8_validate (utf8_name, -1, NULL) == FALSE)
+		g_warning ("File display name is not valid UTF8. Please file a bug report.\n");
+		
+	return utf8_name;
+}
+
+
 const char *
 get_home_uri (void)
 {
@@ -1499,7 +1524,7 @@
 			base_uri_len = strlen (remove_host_from_uri (base_uri));
 			g_free (base_uri);
 
-			name = gnome_vfs_unescape_string_for_display (tmp_path + 1 + base_uri_len);
+			name = get_utf8_display_name_from_uri (tmp_path + 1 + base_uri_len);
 		} 
 		else {
 			const char *base_path;
@@ -1516,10 +1541,10 @@
 				if (uri_len == base_path_len)
 					name = g_strdup (_("Home"));
 				else if (uri_len > base_path_len)
-					name = gnome_vfs_unescape_string_for_display (uri + 1 + base_path_len);
+					name = get_utf8_display_name_from_uri (uri + 1 + base_path_len);
 			} 
 			else
-				name = gnome_vfs_unescape_string_for_display (tmp_path);
+				name = get_utf8_display_name_from_uri (tmp_path);
 		}
 	}
 
@@ -1619,7 +1644,7 @@
 char *
 basename_for_display (const char *uri)
 {
-	return gnome_vfs_unescape_string_for_display (file_name_from_path (uri));
+	return get_utf8_display_name_from_uri (file_name_from_path (uri));
 }
 
 
@@ -2145,7 +2170,7 @@
 		rel_path = full_path + strlen (base_path) + 1;
 		g_free (base_path);
 
-		utf8_path = gnome_vfs_unescape_string_for_display (rel_path);
+		utf8_path = get_utf8_display_name_from_uri (rel_path);
 
 		switch (gnome_vfs_result_from_errno ()) {
 		case GNOME_VFS_ERROR_DIRECTORY_NOT_EMPTY:

Modified: trunk/libgthumb/file-utils.h
==============================================================================
--- trunk/libgthumb/file-utils.h	(original)
+++ trunk/libgthumb/file-utils.h	Wed Jan 23 15:24:42 2008
@@ -158,6 +158,7 @@
 
 /* URI/Path utils */
 
+char *		    get_utf8_display_name_from_uri (const char      *uri);
 const char *        get_home_uri                  (void);
 const char *        get_file_path_from_uri        (const char       *uri);
 const char *        get_catalog_path_from_uri     (const char       *uri);

Modified: trunk/libgthumb/gtk-utils.c
==============================================================================
--- trunk/libgthumb/gtk-utils.c	(original)
+++ trunk/libgthumb/gtk-utils.c	Wed Jan 23 15:24:42 2008
@@ -739,7 +739,7 @@
 
 	if (text == NULL)
 		text = "";
-	utf8_text = gnome_vfs_unescape_string_for_display (text);
+	utf8_text = get_utf8_display_name_from_uri (text);
 	gtk_entry_set_text (entry, utf8_text);
 	g_free (utf8_text);
 }
@@ -769,7 +769,7 @@
 
 	if (text == NULL)
 		text = "";
-	utf8_text = gnome_vfs_unescape_string_for_display (text);
+	utf8_text = get_utf8_display_name_from_uri (text);
 	gtk_label_set_text (label, utf8_text);
 	g_free (utf8_text);
 }

Modified: trunk/src/catalog-list.c
==============================================================================
--- trunk/src/catalog-list.c	(original)
+++ trunk/src/catalog-list.c	Wed Jan 23 15:24:42 2008
@@ -563,7 +563,7 @@
 		else
 			pixbuf = dir_pixbuf;
 
-		display_name = gnome_vfs_unescape_string_for_display (name);
+		display_name = get_utf8_display_name_from_uri (name);
 		gtk_list_store_append (cat_list->list_store, &iter);
 		gtk_list_store_set (cat_list->list_store, &iter,
 				    CAT_LIST_COLUMN_ICON, pixbuf,
@@ -594,7 +594,7 @@
 			}
 
 			name = remove_extension_from_path (file->name);
-			utf8_name = gnome_vfs_unescape_string_for_display (name);
+			utf8_name = get_utf8_display_name_from_uri (name);
 			
 			gtk_list_store_append (cat_list->list_store, &iter);
 			gtk_list_store_set (cat_list->list_store, &iter,

Modified: trunk/src/catalog-png-exporter.c
==============================================================================
--- trunk/src/catalog-png-exporter.c	(original)
+++ trunk/src/catalog-png-exporter.c	Wed Jan 23 15:24:42 2008
@@ -821,19 +821,19 @@
 
 	if ((ce->caption_fields & GTH_CAPTION_FILE_PATH)
 	    && (ce->caption_fields & GTH_CAPTION_FILE_NAME)) {
-		char *utf8_name = gnome_vfs_unescape_string_for_display (idata->file->path);
+		char *utf8_name = get_utf8_display_name_from_uri (idata->file->path);
 		idata->caption_row[row++] = utf8_name;
 	} 
 	else {
 		if (ce->caption_fields & GTH_CAPTION_FILE_PATH) {
 			char *path = remove_level_from_path (idata->file->path);
-			char *utf8_name = gnome_vfs_unescape_string_for_display (path);
+			char *utf8_name = get_utf8_display_name_from_uri (path);
 			idata->caption_row[row++] = utf8_name;
 			g_free (path);
 		} 
 		else if (ce->caption_fields & GTH_CAPTION_FILE_NAME) {
 			const char *name = file_name_from_path (idata->file->path);
-			char *utf8_name = gnome_vfs_unescape_string_for_display (name);
+			char *utf8_name = get_utf8_display_name_from_uri (name);
 			idata->caption_row[row++] = utf8_name;
 		}
 	}
@@ -1655,7 +1655,7 @@
 	g_free (ce->info);
 
 	filename = _g_get_name_from_template (ce->templatev, ce->start_at + page_n - 1);
-	utf8_name = gnome_vfs_unescape_string_for_display (filename);
+	utf8_name = get_utf8_display_name_from_uri (filename);
 	ce->info = g_strdup_printf (_("Creating image: %s.%s"),
 				    utf8_name,
 				    ce->file_type);

Modified: trunk/src/dlg-duplicates.c
==============================================================================
--- trunk/src/dlg-duplicates.c	(original)
+++ trunk/src/dlg-duplicates.c	Wed Jan 23 15:24:42 2008
@@ -538,11 +538,11 @@
 			continue;
 
 		location = remove_level_from_path (idata2->path);
-		location_utf8 = gnome_vfs_unescape_string_for_display (location);
+		location_utf8 = get_utf8_display_name_from_uri (location);
 		g_free (location);
 
 		name = file_name_from_path (idata2->path);
-		name_utf8 = gnome_vfs_unescape_string_for_display (name);
+		name_utf8 = get_utf8_display_name_from_uri (name);
 
 		tm = localtime (&idata2->last_modified);
 		strftime (time_txt, 50, _("%d %B %Y, %H:%M"), tm);

Modified: trunk/src/dlg-file-utils.c
==============================================================================
--- trunk/src/dlg-file-utils.c	(original)
+++ trunk/src/dlg-file-utils.c	Wed Jan 23 15:24:42 2008
@@ -101,7 +101,7 @@
 
 	if (! ensure_dir_exists (dir, 0755)) {
 		char *utf8_path;
-		utf8_path = gnome_vfs_unescape_string_for_display (dir);
+		utf8_path = get_utf8_display_name_from_uri (dir);
 		_gtk_error_dialog_run (GTK_WINDOW (window),
 				       _("Could not create folder \"%s\": %s."),
 				       utf8_path,
@@ -115,7 +115,7 @@
 
 	if (! check_permissions (dir, R_OK | W_OK | X_OK)) {
 		char *utf8_path;
-		utf8_path = gnome_vfs_unescape_string_for_display (dir);
+		utf8_path = get_utf8_display_name_from_uri (dir);
 		_gtk_error_dialog_run (GTK_WINDOW (window),
 				       _("You don't have the right permissions to create images in the folder \"%s\""),
 				       utf8_path);
@@ -533,7 +533,7 @@
 	_gtk_label_set_filename_text (GTK_LABEL (label), name);
 	g_free (name);
 
-	utf8_name = gnome_vfs_unescape_string_for_display (filename);
+	utf8_name = get_utf8_display_name_from_uri (filename);
 	gtk_tooltips_set_tip (tooltips, eventbox, utf8_name, NULL);
 	g_free (utf8_name);
 
@@ -790,7 +790,7 @@
 			if (path_is_file (new_path)) {
 				char *utf8_name;
 
-				utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+				utf8_name = get_utf8_display_name_from_uri (new_name);
 				_gtk_error_dialog_run (GTK_WINDOW (owdata->window),
 						       _("The name \"%s\" is already used in this folder. Please use a different name."),
 						       utf8_name);
@@ -891,7 +891,7 @@
 		if (path_is_file (new_path)) {
 			char *utf8_name;
 
-			utf8_name = gnome_vfs_unescape_string_for_display (*new_name);
+			utf8_name = get_utf8_display_name_from_uri (*new_name);
 			_gtk_error_dialog_run (GTK_WINDOW (owdata->window),
 					       _("The name \"%s\" is already used in this folder. Please use a different name."),
 					       utf8_name);

Modified: trunk/src/dlg-photo-importer.c
==============================================================================
--- trunk/src/dlg-photo-importer.c	(original)
+++ trunk/src/dlg-photo-importer.c	Wed Jan 23 15:24:42 2008
@@ -1776,7 +1776,7 @@
 	if (! ensure_dir_exists (data->local_folder, 0755)) {
 		char *utf8_path;
 		char *msg;
-		utf8_path = gnome_vfs_unescape_string_for_display (data->local_folder);
+		utf8_path = get_utf8_display_name_from_uri (data->local_folder);
 		msg = g_strdup_printf (_("Could not create the folder \"%s\": %s"),
 				       utf8_path,
 				       errno_to_string ());
@@ -1793,7 +1793,7 @@
 	if (! check_permissions (data->local_folder, R_OK | W_OK | X_OK)) {
 		char *utf8_path;
 		char *msg;
-		utf8_path = gnome_vfs_unescape_string_for_display (data->local_folder);
+		utf8_path = get_utf8_display_name_from_uri (data->local_folder);
 		msg = g_strdup_printf (_("You don't have the right permissions to create images in the folder \"%s\""), utf8_path);
 
 		display_error_dialog (data, _("Could not import photos"), msg);

Modified: trunk/src/dlg-rename-series.c
==============================================================================
--- trunk/src/dlg-rename-series.c	(original)
+++ trunk/src/dlg-rename-series.c	Wed Jan 23 15:24:42 2008
@@ -381,7 +381,7 @@
 		char	 *original_enum = NULL;
 
 		name1 = _g_get_name_from_template (template, start_at++);
-		utf8_txt = gnome_vfs_unescape_string_for_display (name_wo_ext);
+		utf8_txt = get_utf8_display_name_from_uri (name_wo_ext);
 		name2 = _g_substitute_pattern (name1, 'f', utf8_txt);
 		g_free (name_wo_ext);
 		g_free (utf8_txt);
@@ -452,8 +452,8 @@
 
 		gtk_list_store_append (data->rs_list_model, &iter);
 
-		utf8_on = gnome_vfs_unescape_string_for_display (fdata->name);
-		utf8_nn = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_on = get_utf8_display_name_from_uri (fdata->name);
+		utf8_nn = get_utf8_display_name_from_uri (new_name);
 		gtk_list_store_set (data->rs_list_model, &iter,
 				    RS_OLDNAME_COLUMN, utf8_on,
 				    RS_NEWNAME_COLUMN, utf8_nn,
@@ -640,7 +640,7 @@
 		glong       last_dot_pos;
 		char       *template;
 
-		template = gnome_vfs_unescape_string_for_display (fd->name);
+		template = get_utf8_display_name_from_uri (fd->name);
 		gtk_entry_set_text (GTK_ENTRY (data->rs_template_entry), template);
 		last_dot = g_utf8_strrchr (template, -1, '.');
 		if (last_dot != NULL)

Modified: trunk/src/dlg-scripts.c
==============================================================================
--- trunk/src/dlg-scripts.c	(original)
+++ trunk/src/dlg-scripts.c	Wed Jan 23 15:24:42 2008
@@ -575,9 +575,9 @@
 			char *new_file_list;
 
 			if (is_local_file (scan->data))
-				filename = gnome_vfs_unescape_string_for_display (remove_host_from_uri (scan->data));
+				filename = get_utf8_display_name_from_uri (remove_host_from_uri (scan->data));
 			else
-				filename = gnome_vfs_unescape_string_for_display (scan->data);
+				filename = get_utf8_display_name_from_uri (scan->data);
 
 			e_filename = shell_escape (filename);
 
@@ -632,9 +632,9 @@
 			load_thumbnail (data, scan->data);
 
 			if (is_local_file (scan->data))
-				filename = gnome_vfs_unescape_string_for_display (remove_host_from_uri (scan->data));
+				filename = get_utf8_display_name_from_uri (remove_host_from_uri (scan->data));
 			else
-				filename = gnome_vfs_unescape_string_for_display (scan->data);
+				filename = get_utf8_display_name_from_uri (scan->data);
 
 			name_wo_ext = remove_extension_from_path (filename);
 			extension = g_filename_to_utf8 (strrchr (filename, '.'), -1, 0, 0, 0);

Modified: trunk/src/dlg-web-exporter.c
==============================================================================
--- trunk/src/dlg-web-exporter.c	(original)
+++ trunk/src/dlg-web-exporter.c	Wed Jan 23 15:24:42 2008
@@ -688,7 +688,7 @@
 			    || (strcmp (info->name, "..") == 0))
 				continue;
 
-			utf8_name = gnome_vfs_unescape_string_for_display (info->name);
+			utf8_name = get_utf8_display_name_from_uri (info->name);
 
 			gtk_list_store_append (tdata->list_store, &iter);
 			gtk_list_store_set (tdata->list_store, &iter,

Modified: trunk/src/gth-browser-actions-callbacks.c
==============================================================================
--- trunk/src/gth-browser-actions-callbacks.c	(original)
+++ trunk/src/gth-browser-actions-callbacks.c	Wed Jan 23 15:24:42 2008
@@ -263,7 +263,7 @@
 		GtkWidget *d;
 		int        r;
 
-		utf8_path = gnome_vfs_unescape_string_for_display (old_path);
+		utf8_path = get_utf8_display_name_from_uri (old_path);
 		msg = g_strdup_printf (_("Could not duplicate the image \"%s\": %s"),
 				       utf8_path,
 				       errno_to_string ());
@@ -460,7 +460,7 @@
 		name_only = remove_extension_from_path (file_name_from_path (catalog_path));
 	else
 		name_only = g_strdup (file_name_from_path (catalog_path));
-	name_only_utf8 = gnome_vfs_unescape_string_for_display (name_only);
+	name_only_utf8 = get_utf8_display_name_from_uri (name_only);
 	new_name_utf8 = _gtk_request_dialog_run (GTK_WINDOW (browser),
 						 GTK_DIALOG_MODAL,
 						 _("Enter the new name: "),
@@ -481,7 +481,7 @@
 	if (strchr (new_name, '/') != NULL) {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_name = get_utf8_display_name_from_uri (new_name);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       _("The name \"%s\" is not valid because it contains the character \"/\". " "Please use a different name."), utf8_name);
 
@@ -503,7 +503,7 @@
 	if (path_is_file (new_catalog_path)) {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_name = get_utf8_display_name_from_uri (new_name);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       _("The name \"%s\" is already used. " "Please use a different name."), utf8_name);
 		g_free (utf8_name);
@@ -515,7 +515,7 @@
 	else {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (name_only);
+		utf8_name = get_utf8_display_name_from_uri (name_only);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       is_dir ? _("Could not rename the library \"%s\": %s") : _("Could not rename the catalog \"%s\": %s"),
 				       utf8_name,
@@ -697,7 +697,7 @@
 	if (strchr (new_name, '/') != NULL) {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_name = get_utf8_display_name_from_uri (new_name);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       _("The name \"%s\" is not valid because it contains the character \"/\". " "Please use a different name."), utf8_name);
 
@@ -716,7 +716,7 @@
 	if (path_is_file (new_catalog_path)) {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_name = get_utf8_display_name_from_uri (new_name);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       _("The name \"%s\" is already used. " "Please use a different name."), utf8_name);
 		g_free (utf8_name);
@@ -728,7 +728,7 @@
 	} else {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_name = get_utf8_display_name_from_uri (new_name);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       _("Could not create the catalog \"%s\": %s"),
 				       utf8_name,
@@ -780,7 +780,7 @@
 	if (strchr (new_name, '/') != NULL) {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_name = get_utf8_display_name_from_uri (new_name);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       _("The name \"%s\" is not valid because it contains the character \"/\". " "Please use a different name."), utf8_name);
 		g_free (utf8_name);
@@ -796,7 +796,7 @@
 	if (path_is_dir (new_path)) {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_name = get_utf8_display_name_from_uri (new_name);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       _("The name \"%s\" is already used. " "Please use a different name."), utf8_name);
 		g_free (utf8_name);
@@ -804,7 +804,7 @@
 	else if (! dir_make (new_path, 0755)) {
 		char *utf8_path;
 
-		utf8_path = gnome_vfs_unescape_string_for_display (new_path);
+		utf8_path = get_utf8_display_name_from_uri (new_path);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       str_error,
 				       utf8_path,
@@ -969,7 +969,7 @@
 		return;
 
 	old_name = file_name_from_path (old_path);
-	old_name_utf8 = gnome_vfs_unescape_string_for_display (old_name);
+	old_name_utf8 = get_utf8_display_name_from_uri (old_name);
 
 	new_name_utf8 = _gtk_request_dialog_run (window,
 						 GTK_DIALOG_MODAL,
@@ -989,7 +989,7 @@
 	if (strchr (new_name, '/') != NULL) {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_name = get_utf8_display_name_from_uri (new_name);
 		_gtk_error_dialog_run (window,
 				       _("The name \"%s\" is not valid because it contains the character \"/\". " "Please use a different name."), utf8_name);
 		g_free (utf8_name);
@@ -1009,7 +1009,7 @@
 	if (same_uri (old_path, new_path)) {
 		char *utf8_path;
 
-		utf8_path = gnome_vfs_unescape_string_for_display (old_path);
+		utf8_path = get_utf8_display_name_from_uri (old_path);
 		_gtk_error_dialog_run (window,
 				       _("Could not rename the folder \"%s\": %s"),
 				       utf8_path,
@@ -1019,7 +1019,7 @@
 	else if (path_is_dir (new_path)) {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (new_name);
+		utf8_name = get_utf8_display_name_from_uri (new_name);
 		_gtk_error_dialog_run (window,
 				       _("The name \"%s\" is already used. " "Please use a different name."), utf8_name);
 		g_free (utf8_name);
@@ -1044,7 +1044,7 @@
 		} 
 		else {
 			char *utf8_path;
-			utf8_path = gnome_vfs_unescape_string_for_display (old_path);
+			utf8_path = get_utf8_display_name_from_uri (old_path);
 			_gtk_error_dialog_run (window,
 					       _("Could not rename the folder \"%s\": %s"),
 					       utf8_path,
@@ -1287,7 +1287,7 @@
 	if (same_uri (old_path, new_path)) {
 		char *utf8_path;
 
-		utf8_path = gnome_vfs_unescape_string_for_display (old_path);
+		utf8_path = get_utf8_display_name_from_uri (old_path);
 
 		_gtk_error_dialog_run (GTK_WINDOW (window),
 				       message,
@@ -1298,7 +1298,7 @@
 	else if (path_in_path (old_path, new_path)) {
 		char *utf8_path;
 
-		utf8_path = gnome_vfs_unescape_string_for_display (old_path);
+		utf8_path = get_utf8_display_name_from_uri (old_path);
 
 		_gtk_error_dialog_run (GTK_WINDOW (window),
 				       message,
@@ -1309,7 +1309,7 @@
 	else if (path_is_dir (new_path)) {
 		char *utf8_name;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (dir_name);
+		utf8_name = get_utf8_display_name_from_uri (dir_name);
 
 		_gtk_error_dialog_run (GTK_WINDOW (window),
 				       message,
@@ -1359,7 +1359,7 @@
 		else {
 			char *utf8_path;
 
-			utf8_path = gnome_vfs_unescape_string_for_display (old_path);
+			utf8_path = get_utf8_display_name_from_uri (old_path);
 			_gtk_error_dialog_run (GTK_WINDOW (window),
 					       message,
 					       utf8_path,

Modified: trunk/src/gth-browser.c
==============================================================================
--- trunk/src/gth-browser.c	(original)
+++ trunk/src/gth-browser.c	Wed Jan 23 15:24:42 2008
@@ -645,7 +645,7 @@
 	images = gth_file_view_get_images (priv->file_list->view);
 	current = gth_file_list_pos_from_path (priv->file_list, priv->image->path) + 1;
 
-	display_name = gnome_vfs_unescape_string_for_display (file_name_from_path (priv->image->path));
+	display_name = get_utf8_display_name_from_uri (file_name_from_path (priv->image->path));
 	escaped_name = g_markup_escape_text (display_name, -1);
 
 	text = g_strdup_printf ("%d/%d - <b>%s</b> %s",
@@ -675,7 +675,7 @@
 		if ((priv->sidebar_content == GTH_SIDEBAR_DIR_LIST)
 		    && (priv->dir_list->path != NULL)) {			
 			char *dir_name = get_uri_display_name (priv->dir_list->path);
-			char *display_name = gnome_vfs_unescape_string_for_display (dir_name);
+			char *display_name = get_utf8_display_name_from_uri (dir_name);
 			info_txt = g_strconcat (display_name, " ", modified, NULL);
 			g_free (dir_name);
 			g_free (display_name);
@@ -691,7 +691,7 @@
 			/* Cut out the file extension. */
 			cat_name_no_ext[strlen (cat_name_no_ext) - 4] = 0;
 
-			info_txt = gnome_vfs_unescape_string_for_display (cat_name_no_ext);
+			info_txt = get_utf8_display_name_from_uri (cat_name_no_ext);
 			g_free (cat_name_no_ext);
 		} 
 		else
@@ -701,12 +701,12 @@
 		char *image_name;
 		int   images, current;
 
-		image_name = gnome_vfs_unescape_string_for_display (file_name_from_path (priv->image->path));
+		image_name = get_utf8_display_name_from_uri (file_name_from_path (priv->image->path));
 		images = gth_file_view_get_images (priv->file_list->view);
 		current = gth_file_list_pos_from_path (priv->file_list, priv->image->path) + 1;
 
 		if (priv->image_catalog != NULL) {
-			char *cat_name = gnome_vfs_unescape_string_for_display (file_name_from_path (priv->image_catalog));
+			char *cat_name = get_utf8_display_name_from_uri (file_name_from_path (priv->image_catalog));
 
 			/* Cut out the file extension. */
 			cat_name[strlen (cat_name) - 4] = 0;
@@ -6305,7 +6305,7 @@
 		char *utf8_path;
 		char *parent_dir = NULL;
 		
-		utf8_path = gnome_vfs_unescape_string_for_display (dir_list->try_path);
+		utf8_path = get_utf8_display_name_from_uri (dir_list->try_path);
 		_gtk_error_dialog_run (GTK_WINDOW (browser),
 				       _("Cannot load folder \"%s\": %s\n"),
 				       utf8_path,

Modified: trunk/src/gth-dir-list.c
==============================================================================
--- trunk/src/gth-dir-list.c	(original)
+++ trunk/src/gth-dir-list.c	Wed Jan 23 15:24:42 2008
@@ -412,7 +412,7 @@
 		else
 			pixbuf = dir_pixbuf;
 
-		utf8_name = gnome_vfs_unescape_string_for_display (name);
+		utf8_name = get_utf8_display_name_from_uri (name);
 		gtk_list_store_append (dir_list->list_store, &iter);
 		gtk_list_store_set (dir_list->list_store, &iter,
 				    DIR_LIST_COLUMN_ICON, pixbuf,
@@ -651,7 +651,7 @@
 
 	pixbuf = dir_pixbuf;
 
-	utf8_name = gnome_vfs_unescape_string_for_display (name_only);
+	utf8_name = get_utf8_display_name_from_uri (name_only);
 	gtk_list_store_insert (dir_list->list_store, &iter, pos);
 	gtk_list_store_set (dir_list->list_store, &iter,
 			    DIR_LIST_COLUMN_ICON, pixbuf,

Modified: trunk/src/gth-exif-data-viewer.c
==============================================================================
--- trunk/src/gth-exif-data-viewer.c	(original)
+++ trunk/src/gth-exif-data-viewer.c	Wed Jan 23 15:24:42 2008
@@ -353,7 +353,7 @@
 		return;
 
 	utf8_name = basename_for_display (edv->priv->file->path);
-	utf8_fullname = gnome_vfs_unescape_string_for_display (edv->priv->file->path);
+	utf8_fullname = get_utf8_display_name_from_uri (edv->priv->file->path);
 
 	if (!image_viewer_is_void (IMAGE_VIEWER (edv->priv->viewer))) {
 		width = image_viewer_get_image_width (edv->priv->viewer);

Modified: trunk/src/gth-fullscreen.c
==============================================================================
--- trunk/src/gth-fullscreen.c	(original)
+++ trunk/src/gth-fullscreen.c	Wed Jan 23 15:24:42 2008
@@ -783,7 +783,7 @@
 	char *utf8_text;
 	char *escaped_text;
 
-	utf8_text = gnome_vfs_unescape_string_for_display (text);
+	utf8_text = get_utf8_display_name_from_uri (text);
 	escaped_text = g_markup_escape_text (utf8_text, -1);
 	g_free (utf8_text);
 

Modified: trunk/src/gth-location.c
==============================================================================
--- trunk/src/gth-location.c	(original)
+++ trunk/src/gth-location.c	Wed Jan 23 15:24:42 2008
@@ -836,7 +836,7 @@
 			if (same_uri (uri, home_uri))
 				uri_name = g_strdup (_("Home"));
 			else
-				uri_name = gnome_vfs_unescape_string_for_display (file_name_from_path (uri));
+				uri_name = get_utf8_display_name_from_uri (file_name_from_path (uri));
 		}
 
 		gtk_list_store_insert (loc->priv->model, &iter, pos++);



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