[gnome-photos/wip/rishi/tracker3: 4/5] utils: Add photos_utils_is_flatpak




commit 84625c7468bfec462520b05da67f5eea2e3647f1
Author: Sam Thursfield <sam afuera me uk>
Date:   Sat Mar 6 14:04:26 2021 +0100

    utils: Add photos_utils_is_flatpak
    
    https://gitlab.gnome.org/GNOME/gnome-photos/-/issues/152

 src/photos-utils.c | 10 ++++++++++
 src/photos-utils.h |  2 ++
 2 files changed, 12 insertions(+)
---
diff --git a/src/photos-utils.c b/src/photos-utils.c
index 1d7be577..76e8f5e0 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -1132,6 +1132,16 @@ photos_utils_get_version (void)
 }
 
 
+gboolean
+photos_utils_is_flatpak (void)
+{
+  gboolean ret_val;
+
+  ret_val = g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS);
+  return ret_val;
+}
+
+
 void
 photos_utils_launch_online_accounts (const gchar *account_id)
 {
diff --git a/src/photos-utils.h b/src/photos-utils.h
index a4d69abf..1e7a4cb7 100644
--- a/src/photos-utils.h
+++ b/src/photos-utils.h
@@ -154,6 +154,8 @@ GList           *photos_utils_get_urns_from_items         (GList *items);
 
 const gchar     *photos_utils_get_version                 (void);
 
+gboolean         photos_utils_is_flatpak                  (void);
+
 void             photos_utils_launch_online_accounts      (const gchar *account_id);
 
 void             photos_utils_list_box_header_func        (GtkListBoxRow *row,


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