[gnome-shell/benzea/systemd-user-units: 204/211] extensionSystem: Redefine canChange property



commit 48aa9fdba9ebc74010fa18cfb7da611139b06c5f
Author: Benjamin Berg <bberg redhat com>
Date:   Thu Aug 1 16:17:20 2019 +0200

    extensionSystem: Redefine canChange property
    
    The canChange property was not actually reflecting whether
    the enableExtension or disableExtension can change the underlying
    setting. Instead the property was showing whether such a change will
    have an effect.
    
    Rename the old canChange property to willChange and set canChange to
    whether the underlying key is writable.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/507

 js/misc/extensionUtils.js | 2 +-
 js/ui/extensionSystem.js  | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/js/misc/extensionUtils.js b/js/misc/extensionUtils.js
index a05a88418..94f688a89 100644
--- a/js/misc/extensionUtils.js
+++ b/js/misc/extensionUtils.js
@@ -31,7 +31,7 @@ var ExtensionState = {
     UNINSTALLED: 99
 };
 
-const SERIALIZED_PROPERTIES = ['type', 'state', 'path', 'error', 'hasPrefs', 'canChange'];
+const SERIALIZED_PROPERTIES = ['type', 'state', 'path', 'error', 'hasPrefs', 'canChange', 'willChange'];
 
 /**
  * getCurrentExtension:
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index fd7196972..54749061a 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -239,6 +239,7 @@ var ExtensionManager = class {
             path: dir.get_path(),
             error: '',
             hasPrefs: dir.get_child('prefs.js').query_exists(null),
+            willChange: false,
             canChange: false
         };
         this._extensions.set(uuid, extension);
@@ -363,10 +364,11 @@ var ExtensionManager = class {
             ? DISABLE_USER_EXTENSIONS_KEY
             : ENABLED_EXTENSIONS_KEY;
 
-        extension.canChange =
+        extension.willChange =
             !hasError &&
             global.settings.is_writable(changeKey) &&
             (isMode || !modeOnly);
+        extension.canChange = global.settings.is_writable(ENABLED_EXTENSIONS_KEY);
     }
 
     _getEnabledExtensions() {


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