[gnome-photos/wip/rishi/zoom: 7/9] glib: Add photos_action_name_strip_prefix
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/zoom: 7/9] glib: Add photos_action_name_strip_prefix
- Date: Thu, 1 Jun 2017 18:17:45 +0000 (UTC)
commit aee03886747087c50717010f7702d5cfa7ee5854
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Jun 1 20:10:50 2017 +0200
glib: Add photos_action_name_strip_prefix
src/photos-glib.c | 16 ++++++++++++++++
src/photos-glib.h | 2 ++
2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-glib.c b/src/photos-glib.c
index 55eff0d..3a18bd7 100644
--- a/src/photos-glib.c
+++ b/src/photos-glib.c
@@ -44,6 +44,22 @@ struct _PhotosGLibFileCreateData
};
+const gchar *
+photos_action_name_strip_prefix (const gchar *action_name_with_prefix)
+{
+ const gchar *action_name;
+
+ g_return_val_if_fail (action_name_with_prefix != NULL, NULL);
+ g_return_val_if_fail (g_action_name_is_valid (action_name_with_prefix), NULL);
+
+ action_name = strchr (action_name_with_prefix, '.');
+ g_return_val_if_fail (action_name != NULL, NULL);
+
+ action_name++;
+ return action_name;
+}
+
+
gboolean
photos_glib_app_info_launch_uri (GAppInfo *appinfo,
const gchar *uri,
diff --git a/src/photos-glib.h b/src/photos-glib.h
index 7c3dbb9..d1a8b88 100644
--- a/src/photos-glib.h
+++ b/src/photos-glib.h
@@ -29,6 +29,8 @@
G_BEGIN_DECLS
+const gchar *photos_action_name_strip_prefix (const gchar *action_name_with_prefix);
+
gboolean photos_glib_app_info_launch_uri (GAppInfo *appinfo,
const gchar *uri,
GAppLaunchContext *launch_context,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]