[gnumeric] GUI: Improve quit dialog for non-ascii file names.



commit b7fdc66ac0efd351365cad90a6cb610dc58f0e86
Author: Morten Welinder <terra gnome org>
Date:   Thu Mar 17 12:57:33 2011 -0400

    GUI: Improve quit dialog for non-ascii file names.

 NEWS                      |    1 +
 src/dialogs/ChangeLog     |    5 +++++
 src/dialogs/dialog-quit.c |   11 +++++++++--
 3 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/NEWS b/NEWS
index 49d15ab..5079bb4 100644
--- a/NEWS
+++ b/NEWS
@@ -37,6 +37,7 @@ Morten:
 	* Improve dbf codepage support.  [#644189]
 	* Improve date format consistency in document properies.  [#644217]
 	* Hopefully make print preview work on win32.  [#533795]
+	* Improve quit dialog's non-ascii handling.  [#644982]
 
 Stanley Pinchak:
 	* Improve "dif" output.
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 0aa1e7e..7775ca9 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,8 @@
+2011-03-17  Morten Welinder  <terra gnome org>
+
+	* dialog-quit.c (url_renderer_func): Decode URIs before display.
+	Fixes #644982.
+
 2011-03-08  Andreas J. Guelzow <aguelzow pyrshep ca>
 
 	* cell-format.ui: formulas -> formulæ
diff --git a/src/dialogs/dialog-quit.c b/src/dialogs/dialog-quit.c
index 22fedc5..18e67c3 100644
--- a/src/dialogs/dialog-quit.c
+++ b/src/dialogs/dialog-quit.c
@@ -61,7 +61,7 @@ url_renderer_func (GtkTreeViewColumn *tree_column,
 {
 	GODoc *doc = NULL;
 	const char *uri;
-	char *markup, *shortname, *filename;
+	char *markup, *shortname, *filename, *longname, *duri;
 
 	gtk_tree_model_get (model, iter,
 			    QUIT_COL_DOC, &doc,
@@ -76,13 +76,20 @@ url_renderer_func (GtkTreeViewColumn *tree_column,
 		shortname = g_filename_display_basename (uri);
 	}
 
+	duri = go_url_decode (uri);
+	longname = duri
+		? g_filename_display_name (duri)
+		: g_strdup (uri);
+
 	markup = g_markup_printf_escaped (_("<b>%s</b>\n"
 					    "<small>Location: %s</small>"),
 					  shortname,
-					  uri);
+					  longname);
 	g_object_set (cell, "markup", markup, NULL);
 	g_free (markup);
 	g_free (shortname);
+	g_free (longname);
+	g_free (duri);
 	g_free (filename);
 }
 



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