extensionSystem: Add canChange property to extensions
Whether or not an extension can be enabled/disabled depends on various factors: Whether the extension is in error state, whether user extensions are disabled and whether the underlying GSettings keys are writable. This is complex enough to share the logic, so add it to the extension properties that are exposed over D-Bus. https://bugzilla.gnome.org/show_bug.cgi?id=789852
This commit is contained in:

committed by
Florian Müllner

parent
32e0b895a4
commit
4a3476266f
@ -30,7 +30,7 @@ var ExtensionState = {
|
||||
UNINSTALLED: 99
|
||||
};
|
||||
|
||||
const SERIALIZED_PROPERTIES = ['type', 'state', 'path', 'error', 'hasPrefs'];
|
||||
const SERIALIZED_PROPERTIES = ['type', 'state', 'path', 'error', 'hasPrefs', 'canChange'];
|
||||
|
||||
// Maps uuid -> metadata object
|
||||
var extensions = {};
|
||||
@ -219,6 +219,7 @@ function createExtensionObject(uuid, dir, type) {
|
||||
extension.path = dir.get_path();
|
||||
extension.error = '';
|
||||
extension.hasPrefs = dir.get_child('prefs.js').query_exists(null);
|
||||
extension.canChange = false;
|
||||
|
||||
extensions[uuid] = extension;
|
||||
|
||||
|
Reference in New Issue
Block a user