mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-13 07:23:45 +01:00
use girara_xdg_open
This commit is contained in:
parent
c63f033412
commit
a284f75ce9
@ -3,6 +3,7 @@
|
|||||||
#include <girara/statusbar.h>
|
#include <girara/statusbar.h>
|
||||||
#include <girara/session.h>
|
#include <girara/session.h>
|
||||||
#include <girara/settings.h>
|
#include <girara/settings.h>
|
||||||
|
#include <girara/utils.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
@ -123,11 +124,8 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path,
|
|||||||
sc_toggle_index(zathura->ui.session, NULL, 0);
|
sc_toggle_index(zathura->ui.session, NULL, 0);
|
||||||
page_set_delayed(zathura, index_element->target.page_number);
|
page_set_delayed(zathura, index_element->target.page_number);
|
||||||
} else if (index_element->type == ZATHURA_LINK_EXTERNAL) {
|
} else if (index_element->type == ZATHURA_LINK_EXTERNAL) {
|
||||||
char* argv[3] = { "xdg-open", index_element->target.uri, NULL };
|
if (!girara_xdg_open(index_element->target.uri)) {
|
||||||
GError* error = NULL;
|
girara_notify(zathura->ui.session, GIRARA_ERROR, "Failed to run xdg-open.");
|
||||||
if (!g_spawn_async(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, &error)) {
|
|
||||||
girara_notify(zathura->ui.session, GIRARA_ERROR, "Failed to run xdg-open: %s", error->message);
|
|
||||||
g_error_free(error);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user