[gnome-books/wip/hadess/sandboxed-miner: 1/3] application: Make isSandboxed() helper public




commit ba1ee06ef1c2a204cdc421c8fd28938555c72ffc
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Mar 24 14:46:41 2021 +0100

    application: Make isSandboxed() helper public

 src/application.js | 7 +------
 src/utils.js       | 5 +++++
 2 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 7d7493d4..476cf1a4 100644
--- a/src/application.js
+++ b/src/application.js
@@ -161,11 +161,6 @@ var Application = new Lang.Class({
         }
     },
 
-    _isSandboxed: function() {
-       file = Gio.File.new_for_path("/.flatpak-info");
-       return file.query_exists(null);
-    },
-
     vfunc_startup: function() {
         this.parent();
         String.prototype.format = Format.format;
@@ -191,7 +186,7 @@ var Application = new Lang.Class({
             return;
         }
 
-       if (this._isSandboxed()) {
+       if (Utils.isSandboxed()) {
            // if the daemon is not available, run our own copy (for the sandboxed case)
            trackerMinerService = this.get_application_id() + '.Tracker3.Miner.Files';
        } else {
diff --git a/src/utils.js b/src/utils.js
index bb45adfd..5ea2e8c2 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -119,6 +119,11 @@ function actionToggleCallback(action) {
     action.change_state(GLib.Variant.new('b', !state.get_boolean()));
 }
 
+function isSandboxed() {
+    file = Gio.File.new_for_path("/.flatpak-info");
+    return file.query_exists(null);
+}
+
 function populateActionGroup(actionGroup, actionEntries, prefix) {
     actionEntries.forEach(function(actionEntry) {
         let settingsKey = actionEntry.settingsKey;


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