When displaying paths on MS Windows, make them look normal

Change the forward slashes to back slashes as that is normal for paths
in MS Windows.
pull/497/head
Robert Fewell 7 years ago
parent e745f4cfee
commit d44e0ee750

@ -170,7 +170,12 @@ convert_uri_to_unescaped (AssocDialog *assoc_dialog, const gchar *uri, gchar *sc
file_path = convert_uri_to_filename (assoc_dialog, uri, scheme);
if (file_path)
{
uri_u = g_uri_unescape_string (file_path, NULL);
#ifdef G_OS_WIN32 // make path look like a traditional windows path
uri_u = g_strdelimit (uri_u, "/", '\\');
#endif
}
else
uri_u = g_uri_unescape_string (uri, NULL);
@ -489,7 +494,9 @@ gnc_assoc_dialog_create (GtkWindow *parent, AssocDialog *assoc_dialog)
gchar *path_head_ue_str = g_uri_unescape_string (assoc_dialog->path_head, NULL);
gchar *path_head_str = gnc_uri_get_path (path_head_ue_str);
gchar *path_head_label;
#ifdef G_OS_WIN32 // make path look like a traditional windows path
path_head_str = g_strdelimit (path_head_str, "/", '\\');
#endif
// test for current folder being present
if (g_file_test (path_head_str, G_FILE_TEST_IS_DIR))
path_head_label = g_strconcat (_("Path head for files is, "), path_head_str, NULL);

@ -1083,7 +1083,13 @@ gsr_default_associate_handler_file (GNCSplitReg *gsr, Transaction *trans, gboole
GtkWidget *label;
gchar *file_uri_u = g_uri_unescape_string (file_uri, NULL);
gchar *filename = gnc_uri_get_path (file_uri_u);
gchar *uri_label = g_strconcat (_("Existing Association is '"), filename, "'", NULL);
gchar *uri_label;
#ifdef G_OS_WIN32 // make path look like a traditional windows path
filename = g_strdelimit (filename, "/", '\\');
#endif
uri_label = g_strconcat (_("Existing Association is '"), filename, "'", NULL);
PINFO("Path head: '%s', URI: '%s', Filename: '%s'", path_head, uri, filename);
label = gtk_label_new (uri_label);
gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER(dialog), label);

@ -574,6 +574,11 @@ gnc_split_register_get_associate_tooltip (VirtualLocation virt_loc,
if (gnc_uri_is_file_scheme (scheme)) // absolute path
file_path = gnc_uri_get_path (uri);
#ifdef G_OS_WIN32 // make path look like a traditional windows path
if (file_path)
file_path = g_strdelimit (file_path, "/", '\\');
#endif
g_free (scheme);
if (!file_path)
@ -583,6 +588,7 @@ gnc_split_register_get_associate_tooltip (VirtualLocation virt_loc,
gchar *file_uri_u = g_uri_unescape_string (file_path, NULL);
const gchar *filename = gnc_uri_get_path (file_uri_u);
g_free (file_uri_u);
g_free (file_path);
return g_strdup (filename);
}
}

Loading…
Cancel
Save