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.
This commit is contained in:
Robert Fewell 2021-12-11 12:37:50 +00:00
parent 75be800151
commit 11ed0b5db1

View File

@ -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)