[nautilus] application: Move is_sandboxed() to allow re-use
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] application: Move is_sandboxed() to allow re-use
- Date: Thu, 14 Jul 2022 22:10:51 +0000 (UTC)
commit 662a38bb68f6884cb4ca76a3a36430d92ee95317
Author: Corey Berla <corey berla me>
Date: Fri Jun 10 10:14:43 2022 -0700
application: Move is_sandboxed() to allow re-use
Move function is_sandboxed() from mime-actions to nautilus-application
to allow reuse.
src/nautilus-application.c | 15 +++++++++++++++
src/nautilus-application.h | 1 +
src/nautilus-mime-actions.c | 19 ++-----------------
3 files changed, 18 insertions(+), 17 deletions(-)
---
diff --git a/src/nautilus-application.c b/src/nautilus-application.c
index fc5479587..05080733e 100644
--- a/src/nautilus-application.c
+++ b/src/nautilus-application.c
@@ -1520,3 +1520,18 @@ nautilus_application_search (NautilusApplication *self,
window = open_window (self, location);
nautilus_window_search (window, query);
}
+
+gboolean
+nautilus_application_is_sandboxed (void)
+{
+ static gboolean ret;
+
+ static gsize init = 0;
+ if (g_once_init_enter (&init))
+ {
+ ret = g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS);
+ g_once_init_leave (&init, 1);
+ }
+
+ return ret;
+}
diff --git a/src/nautilus-application.h b/src/nautilus-application.h
index 76d741a50..83cc01252 100644
--- a/src/nautilus-application.h
+++ b/src/nautilus-application.h
@@ -85,4 +85,5 @@ GtkWidget * nautilus_application_connect_server (NautilusApplication *applicatio
void nautilus_application_search (NautilusApplication *application,
NautilusQuery *query);
void nautilus_application_startup_common (NautilusApplication *application);
+gboolean nautilus_application_is_sandboxed (void);
G_END_DECLS
diff --git a/src/nautilus-mime-actions.c b/src/nautilus-mime-actions.c
index 3ceb0a953..97fca0c2f 100644
--- a/src/nautilus-mime-actions.c
+++ b/src/nautilus-mime-actions.c
@@ -251,21 +251,6 @@ static void activate_callback (GList *files,
gpointer callback_data);
static void activation_mount_not_mounted (ActivateParameters *parameters);
-static gboolean
-is_sandboxed (void)
-{
- static gboolean ret;
-
- static gsize init = 0;
- if (g_once_init_enter (&init))
- {
- ret = g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS);
- g_once_init_leave (&init, 1);
- }
-
- return ret;
-}
-
static void
launch_location_free (LaunchLocation *location)
{
@@ -1567,7 +1552,7 @@ activate_files (ActivateParameters *parameters)
if (parameters->open_in_app_uris != NULL)
{
- if (is_sandboxed ())
+ if (nautilus_application_is_sandboxed ())
{
num_windows += g_queue_get_length (parameters->open_in_app_uris);
}
@@ -1703,7 +1688,7 @@ activate_files_internal (ActivateParameters *parameters)
}
}
- if (!g_queue_is_empty (parameters->open_in_app_uris) && is_sandboxed ())
+ if (!g_queue_is_empty (parameters->open_in_app_uris) && nautilus_application_is_sandboxed ())
{
const char *uri;
ApplicationLaunchAsyncParameters *async_params;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]