Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
7dc30c9c
Commit
7dc30c9c
authored
Dec 07, 2015
by
Lukas K.
Browse files
move uri basename handling to zathura_document_open
parent
33730545
Changes
2
Show whitespace changes
Inline
Side-by-side
zathura/document.c
View file @
7dc30c9c
...
...
@@ -116,8 +116,15 @@ zathura_document_open(zathura_plugin_manager_t* plugin_manager, const char*
}
document
->
file_path
=
real_path
;
document
->
basename
=
g_file_get_basename
(
file
);
document
->
uri
=
g_strdup
(
uri
);
if
(
document
->
uri
==
NULL
)
{
document
->
basename
=
g_file_get_basename
(
file
);
}
else
{
GFile
*
gf
=
g_file_new_for_uri
(
document
->
uri
);
document
->
basename
=
g_file_get_basename
(
gf
);
g_object_unref
(
gf
);
}
document
->
password
=
password
;
document
->
scale
=
1
.
0
;
document
->
plugin
=
plugin
;
...
...
zathura/zathura.c
View file @
7dc30c9c
...
...
@@ -636,7 +636,7 @@ get_formatted_filename(zathura_t* zathura, bool statusbar)
{
bool
basename_only
=
false
;
const
char
*
file_path
=
zathura_document_get_uri
(
zathura
->
document
);
if
(
file_path
==
NULL
)
{
if
(
file_path
==
NULL
)
{
file_path
=
zathura_document_get_path
(
zathura
->
document
);
}
if
(
statusbar
==
true
)
{
...
...
@@ -673,16 +673,8 @@ get_formatted_filename(zathura_t* zathura, bool statusbar)
return
g_strdup
(
file_path
);
}
}
else
{
char
*
basename
=
NULL
;
if
(
zathura_document_get_uri
(
zathura
->
document
)
==
NULL
)
{
basename
=
g_strdup
(
zathura_document_get_basename
(
zathura
->
document
));
}
else
{
GFile
*
gf
=
g_file_new_for_uri
(
zathura_document_get_uri
(
zathura
->
document
));
basename
=
g_file_get_basename
(
gf
);
g_object_unref
(
gf
);
}
return
basename
;
const
char
*
basename
=
zathura_document_get_basename
(
zathura
->
document
);
return
g_strdup
(
basename
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment