[gnumeric] GUI: don't show file:// for local items in history dialog.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] GUI: don't show file:// for local items in history dialog.
- Date: Wed, 9 Oct 2013 20:03:59 +0000 (UTC)
commit 1684c9eb9ce095533ed38234cff7e856c3f61896
Author: Morten Welinder <terra gnome org>
Date: Wed Oct 9 16:03:28 2013 -0400
GUI: don't show file:// for local items in history dialog.
NEWS | 3 +++
src/dialogs/ChangeLog | 5 +++++
src/dialogs/dialog-recent.c | 16 ++++++++++------
3 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/NEWS b/NEWS
index 5656bfc..ef7b587 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
Gnumeric 1.12.9
+Morten:
+ * Minor improvement to history dialog.
+
--------------------------------------------------------------------------
Gnumeric 1.12.8
diff --git a/src/dialogs/ChangeLog b/src/dialogs/ChangeLog
index 793edd1..db2fbdb 100644
--- a/src/dialogs/ChangeLog
+++ b/src/dialogs/ChangeLog
@@ -1,3 +1,8 @@
+2013-10-09 Morten Welinder <terra gnome org>
+
+ * dialog-recent.c (url_renderer_func): If we have a filename, use
+ that. This hides the "file://" prefix.
+
2013-10-07 Morten Welinder <terra gnome org>
* Release 1.12.8
diff --git a/src/dialogs/dialog-recent.c b/src/dialogs/dialog-recent.c
index 70de499..5971257 100644
--- a/src/dialogs/dialog-recent.c
+++ b/src/dialogs/dialog-recent.c
@@ -85,7 +85,7 @@ url_renderer_func (GtkTreeViewColumn *tree_column,
{
GtkRecentInfo *ri = NULL;
const char *uri;
- char *markup, *shortname, *filename, *longname, *duri;
+ char *markup, *shortname, *filename, *longname;
gtk_tree_model_get (model, iter, RECENT_COL_INFO, &ri, -1);
@@ -97,10 +97,15 @@ url_renderer_func (GtkTreeViewColumn *tree_column,
shortname = g_filename_display_basename (uri);
}
- duri = g_uri_unescape_string (uri, NULL);
- longname = duri
- ? g_filename_display_name (duri)
- : g_strdup (uri);
+ if (filename) {
+ longname = g_strdup (filename);
+ } else {
+ char *duri = g_uri_unescape_string (uri, NULL);
+ longname = duri
+ ? g_filename_display_name (duri)
+ : g_strdup (uri);
+ g_free (duri);
+ }
markup = g_markup_printf_escaped (_("<b>%s</b>\n"
"<small>Location: %s</small>"),
@@ -110,7 +115,6 @@ url_renderer_func (GtkTreeViewColumn *tree_column,
g_free (markup);
g_free (shortname);
g_free (longname);
- g_free (duri);
g_free (filename);
gtk_recent_info_unref (ri);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]