extensionBase: Stop injecting extensionManager
All extension lookups now happen through the dedicated Extension/ExtensionPreferences classes, so the shared code no longer has to access the extensionManager. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2838>
This commit is contained in:
parent
82237a398f
commit
abdd1346da
@ -1,7 +1,6 @@
|
|||||||
import {ExtensionBase, GettextWrapper, setExtensionManager} from './sharedInternals.js';
|
import {ExtensionBase, GettextWrapper} from './sharedInternals.js';
|
||||||
|
|
||||||
const {extensionManager} = imports.ui.main;
|
const {extensionManager} = imports.ui.main;
|
||||||
setExtensionManager(extensionManager);
|
|
||||||
|
|
||||||
export class Extension extends ExtensionBase {
|
export class Extension extends ExtensionBase {
|
||||||
static lookupByUUID(uuid) {
|
static lookupByUUID(uuid) {
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
import GObject from 'gi://GObject';
|
import GObject from 'gi://GObject';
|
||||||
|
|
||||||
import {ExtensionBase, GettextWrapper, setExtensionManager} from './sharedInternals.js';
|
import {ExtensionBase, GettextWrapper} from './sharedInternals.js';
|
||||||
import {extensionManager} from '../extensionsService.js';
|
import {extensionManager} from '../extensionsService.js';
|
||||||
|
|
||||||
setExtensionManager(extensionManager);
|
|
||||||
|
|
||||||
export class ExtensionPreferences extends ExtensionBase {
|
export class ExtensionPreferences extends ExtensionBase {
|
||||||
static lookupByUUID(uuid) {
|
static lookupByUUID(uuid) {
|
||||||
return extensionManager.lookup(uuid)?.stateObj ?? null;
|
return extensionManager.lookup(uuid)?.stateObj ?? null;
|
||||||
|
@ -6,18 +6,6 @@ import {bindtextdomain} from 'gettext';
|
|||||||
|
|
||||||
const Config = imports.misc.config;
|
const Config = imports.misc.config;
|
||||||
|
|
||||||
let _extensionManager = null;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {object} extensionManager to use in utilities like `initTranslations()`
|
|
||||||
*/
|
|
||||||
export function setExtensionManager(extensionManager) {
|
|
||||||
if (_extensionManager)
|
|
||||||
throw new Error('Trying to override existing extension manager');
|
|
||||||
|
|
||||||
_extensionManager = extensionManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ExtensionBase {
|
export class ExtensionBase {
|
||||||
#gettextDomain;
|
#gettextDomain;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user