mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 13:26:00 +01:00
Also handle file:// URIs
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
bf73069d14
commit
c3337bdd80
1 changed files with 16 additions and 8 deletions
|
@ -571,11 +571,18 @@ 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 {
|
||||||
|
char* gf_file_path = g_file_get_path(gf);
|
||||||
|
if (gf_file_path != NULL) {
|
||||||
|
/* file is not given via a native path, but available from a path */
|
||||||
|
file = gf_file_path;
|
||||||
|
} else {
|
||||||
|
/* copy file with GIO */
|
||||||
file = prepare_document_open_from_gfile(document_info->zathura, gf);
|
file = prepare_document_open_from_gfile(document_info->zathura, gf);
|
||||||
if (file == NULL) {
|
if (file == NULL) {
|
||||||
girara_notify(document_info->zathura->ui.session, GIRARA_ERROR,
|
girara_notify(document_info->zathura->ui.session, GIRARA_ERROR,
|
||||||
|
@ -584,6 +591,7 @@ document_info_open(gpointer data)
|
||||||
document_info->zathura->stdin_support.file = g_strdup(file);
|
document_info->zathura->stdin_support.file = g_strdup(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
g_object_unref(gf);
|
g_object_unref(gf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue