From a284f75ce9978d75e848ba0f1eb85091a5651d4d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Sat, 21 Jan 2012 22:03:08 +0100 Subject: [PATCH] use girara_xdg_open --- callbacks.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/callbacks.c b/callbacks.c index eb50328..0fc41ad 100644 --- a/callbacks.c +++ b/callbacks.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include @@ -123,11 +124,8 @@ cb_index_row_activated(GtkTreeView* tree_view, GtkTreePath* path, sc_toggle_index(zathura->ui.session, NULL, 0); page_set_delayed(zathura, index_element->target.page_number); } else if (index_element->type == ZATHURA_LINK_EXTERNAL) { - char* argv[3] = { "xdg-open", index_element->target.uri, NULL }; - GError* error = NULL; - 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); + if (!girara_xdg_open(index_element->target.uri)) { + girara_notify(zathura->ui.session, GIRARA_ERROR, "Failed to run xdg-open."); } } }