Commit 82a6caa2 authored by Moritz Lipp's avatar Moritz Lipp
Browse files

Merge branch 'develop' of pwmt.org:zathura into develop

parents 0b88e118 495c59f8
......@@ -183,9 +183,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;
}
......
......@@ -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);
}
......@@ -440,6 +440,13 @@ zathura_index_element_t* zathura_index_element_new(const char* title);
*/
void zathura_index_element_free(zathura_index_element_t* index);
/**
* Free link
*
* @param link The link
*/
void zathura_link_free(zathura_link_t* link);
/**
* Add type -> plugin mapping
* @param zathura zathura instance
......
Supports Markdown
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