GtkFileChooserWidget: Use ratio in formatted times

This matches what we do in other places now.
This commit is contained in:
Matthias Clasen 2014-08-22 01:47:21 -04:00
parent 23fdc45b95
commit 683a7f1429

View File

@ -3717,6 +3717,22 @@ stop_loading_and_clear_list_model (GtkFileChooserWidget *impl,
gtk_tree_view_set_model (GTK_TREE_VIEW (priv->browse_files_tree_view), NULL);
}
/* Replace 'target' with 'replacement' in the input string. */
static gchar *
string_replace (const gchar *input,
const gchar *target,
const gchar *replacement)
{
gchar **pieces;
gchar *output;
pieces = g_strsplit (input, target, -1);
output = g_strjoinv (replacement, pieces);
g_strfreev (pieces);
return output;
}
static char *
my_g_format_time_for_display (GtkFileChooserWidget *impl,
glong secs)
@ -3750,6 +3766,14 @@ my_g_format_time_for_display (GtkFileChooserWidget *impl,
date_str = g_date_time_format (time, format);
if (g_get_charset (NULL))
{
gchar *ret;
ret = string_replace (date_str, ":", "\xE2\x80\x8E");
g_free (date_str);
date_str = ret;
}
g_date_time_unref (time);
g_date_time_unref (now);