From 085f2d7eef0d77e06977d095927789bf948538a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sat, 27 Nov 2021 02:33:28 +0100 Subject: Use GFile a bit more --- fastiv.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'fastiv.c') diff --git a/fastiv.c b/fastiv.c index 18a3277..4387033 100644 --- a/fastiv.c +++ b/fastiv.c @@ -311,13 +311,17 @@ spawn_path(const char *path) } static void -on_item_activated(G_GNUC_UNUSED FastivBrowser *browser, const char *path, +on_item_activated(G_GNUC_UNUSED FastivBrowser *browser, GFile *location, GtkPlacesOpenFlags flags, G_GNUC_UNUSED gpointer data) { - if (flags == GTK_PLACES_OPEN_NEW_WINDOW) - spawn_path(path); - else - open(path); + gchar *path = g_file_get_path(location); + if (path) { + if (flags == GTK_PLACES_OPEN_NEW_WINDOW) + spawn_path(path); + else + open(path); + g_free(path); + } } static gboolean -- cgit v1.2.3