From 11ed0b5db1f2c73b1ca6ea98473d493991ec7785 Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 11 Dec 2021 12:37:50 +0000 Subject: [PATCH] Fix default folder for the Document link dialogue When the document link is a relative one, we need to convert that to a absolute path so the file chooser current folder can be set correctly. --- gnucash/gnome/dialog-doclink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnucash/gnome/dialog-doclink.c b/gnucash/gnome/dialog-doclink.c index 8991f05b74..a71c91a675 100644 --- a/gnucash/gnome/dialog-doclink.c +++ b/gnucash/gnome/dialog-doclink.c @@ -166,10 +166,12 @@ fcb_clicked_cb (GtkButton *button, GtkWidget *ok_button) if (uri && *uri) { - gchar *full_filename = gnc_uri_get_path (uri); + gchar *scheme = gnc_uri_get_scheme (uri); + gchar *full_filename = gnc_doclink_get_unescape_uri (path_head, uri, scheme); gchar *path = g_path_get_dirname (full_filename); gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(native), path); g_free (full_filename); + g_free (scheme); g_free (path); } else if (path_head)