[gnome-flashback] desktop: use gf_launch_uri to open file
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-flashback] desktop: use gf_launch_uri to open file
- Date: Mon, 11 Nov 2019 20:07:22 +0000 (UTC)
commit aa39114217ebe84b6dce35432eeb2fefed00659d
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Nov 11 17:41:26 2019 +0200
desktop: use gf_launch_uri to open file
gnome-flashback/libdesktop/gf-icon.c | 29 +++++++----------------------
1 file changed, 7 insertions(+), 22 deletions(-)
---
diff --git a/gnome-flashback/libdesktop/gf-icon.c b/gnome-flashback/libdesktop/gf-icon.c
index 4f308d1..00f1ebb 100644
--- a/gnome-flashback/libdesktop/gf-icon.c
+++ b/gnome-flashback/libdesktop/gf-icon.c
@@ -20,6 +20,7 @@
#include "gf-desktop-enums.h"
#include "gf-desktop-enum-types.h"
+#include "gf-utils.h"
struct _GfIcon
{
@@ -80,35 +81,19 @@ update_state (GfIcon *self)
}
static void
-launch_default_for_uri_cb (GObject *object,
- GAsyncResult *res,
- gpointer user_data)
+icon_open (GfIcon *self)
{
+ char *uri;
GError *error;
- error = NULL;
- g_app_info_launch_default_for_uri_finish (res, &error);
+ uri = g_file_get_uri (self->file);
- if (error != NULL)
+ error = NULL;
+ if (!gf_launch_uri (uri, &error))
{
- if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
- g_warning ("%s", error->message);
-
+ g_warning ("%s", error->message);
g_error_free (error);
- return;
}
-}
-
-static void
-icon_open (GfIcon *self)
-{
- char *uri;
-
- uri = g_file_get_uri (self->file);
-
- g_app_info_launch_default_for_uri_async (uri, NULL, NULL,
- launch_default_for_uri_cb,
- NULL);
g_free (uri);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]