[gnome-photos/wip/rishi/share-point: 1/18] utils: Add photos_utils_app_info_launch_uri



commit 0df021c1da6ad1d37b7675ec30946c23ce670887
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Jul 27 23:19:45 2016 +0200

    utils: Add photos_utils_app_info_launch_uri
    
    https://bugzilla.gnome.org/show_bug.cgi?id=751181

 src/photos-utils.c |   18 ++++++++++++++++++
 src/photos-utils.h |    5 +++++
 2 files changed, 23 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-utils.c b/src/photos-utils.c
index cb21e92..734aaf5 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -81,6 +81,24 @@ struct _PhotosUtilsFileCreateData
 };
 
 
+gboolean
+photos_utils_app_info_launch_uri (GAppInfo *appinfo, const gchar *uri, GAppLaunchContext *launch_context, 
GError **error)
+{
+  GList *uris = NULL;
+  gboolean ret_val;
+
+  g_return_val_if_fail (G_IS_APP_INFO (appinfo), FALSE);
+  g_return_val_if_fail (uri != NULL && uri[0] != '\0', FALSE);
+  g_return_val_if_fail (launch_context == NULL || G_IS_APP_LAUNCH_CONTEXT (launch_context), FALSE);
+  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+
+  uris = g_list_prepend (uris, g_strdup (uri));
+  ret_val = g_app_info_launch_uris (appinfo, uris, launch_context, error);
+  g_list_free_full (uris, g_free);
+  return ret_val;
+}
+
+
 static void
 photos_utils_put_pixel (guchar *p)
 {
diff --git a/src/photos-utils.h b/src/photos-utils.h
index 1821811..b3dcbc3 100644
--- a/src/photos-utils.h
+++ b/src/photos-utils.h
@@ -57,6 +57,11 @@ G_BEGIN_DECLS
   "http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#image-category-screenshot";
 #define PHOTOS_EXPORT_SUBPATH "Exports"
 
+gboolean         photos_utils_app_info_launch_uri         (GAppInfo *appinfo,
+                                                           const gchar *uri,
+                                                           GAppLaunchContext *launch_context,
+                                                           GError **error);
+
 void             photos_utils_border_pixbuf               (GdkPixbuf *pixbuf);
 
 void             photos_utils_buffer_zoom_async           (GeglBuffer *buffer,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]