Commit c3337bdd authored by Sebastian Ramacher's avatar Sebastian Ramacher

Also handle file:// URIs

Signed-off-by: Sebastian Ramacher's avatarSebastian Ramacher <sebastian+dev@ramacher.at>
parent bf73069d
Pipeline #29 skipped
...@@ -571,17 +571,25 @@ document_info_open(gpointer data) ...@@ -571,17 +571,25 @@ document_info_open(gpointer data)
document_info->zathura->stdin_support.file = g_strdup(file); document_info->zathura->stdin_support.file = g_strdup(file);
} }
} else { } else {
GFile *gf = g_file_new_for_commandline_arg(document_info->path); GFile* gf = g_file_new_for_commandline_arg(document_info->path);
if(g_file_is_native(gf)) { if (g_file_is_native(gf) == TRUE) {
file = g_strdup(document_info->path); /* file was given as a native path */
file = g_file_get_path(gf);
} }
else { else {
file = prepare_document_open_from_gfile(document_info->zathura, gf); char* gf_file_path = g_file_get_path(gf);
if (file == NULL) { if (gf_file_path != NULL) {
girara_notify(document_info->zathura->ui.session, GIRARA_ERROR, /* file is not given via a native path, but available from a path */
_("Could not read file from GIO and copy it to a temporary file.")); file = gf_file_path;
} else { } else {
document_info->zathura->stdin_support.file = g_strdup(file); /* copy file with GIO */
file = prepare_document_open_from_gfile(document_info->zathura, gf);
if (file == NULL) {
girara_notify(document_info->zathura->ui.session, GIRARA_ERROR,
_("Could not read file from GIO and copy it to a temporary file."));
} else {
document_info->zathura->stdin_support.file = g_strdup(file);
}
} }
} }
g_object_unref(gf); g_object_unref(gf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment