mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2025-01-01 05:45:59 +01:00
add zathura_link_free
This commit is contained in:
parent
86ce201ec9
commit
762f3819d4
2 changed files with 15 additions and 0 deletions
|
@ -181,9 +181,11 @@ cb_sc_follow(GtkEntry* entry, girara_session_t* session)
|
|||
if (link != NULL) {
|
||||
switch (link->type) {
|
||||
case ZATHURA_LINK_TO_PAGE:
|
||||
girara_info("page number: %d", link->target.page_number);
|
||||
page_set_delayed(zathura, link->target.page_number);
|
||||
break;
|
||||
case ZATHURA_LINK_EXTERNAL:
|
||||
girara_info("target: %s", link->target.value);
|
||||
girara_xdg_open(link->target.value);
|
||||
break;
|
||||
}
|
||||
|
|
13
document.c
13
document.c
|
@ -653,3 +653,16 @@ zathura_type_plugin_mapping_free(zathura_type_plugin_mapping_t* mapping)
|
|||
g_free((void*)mapping->type);
|
||||
g_free(mapping);
|
||||
}
|
||||
|
||||
void
|
||||
zathura_link_free(zathura_link_t* link)
|
||||
{
|
||||
if (link == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (link->type == ZATHURA_LINK_EXTERNAL) {
|
||||
g_free(link->target.value);
|
||||
}
|
||||
g_free(link);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue