mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
extensionUtils: Always use manager to find current extension
Now that we always have an extension manager object, we can use the same code path for use from extensions and prefs. For that, inject the D-Bus service's extensionManager instead of the current extension. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2832>
This commit is contained in:
parent
10672597c2
commit
df350cab0a
3 changed files with 13 additions and 29 deletions
|
|
@ -7,8 +7,6 @@ import GLib from 'gi://GLib';
|
|||
import GObject from 'gi://GObject';
|
||||
import Gtk from 'gi://Gtk?version=4.0';
|
||||
|
||||
const ExtensionUtils = imports.misc.extensionUtils;
|
||||
|
||||
export const ExtensionPrefsDialog = GObject.registerClass({
|
||||
GTypeName: 'ExtensionPrefsDialog',
|
||||
}, class ExtensionPrefsDialog extends Adw.PreferencesWindow {
|
||||
|
|
@ -27,9 +25,6 @@ export const ExtensionPrefsDialog = GObject.registerClass({
|
|||
}
|
||||
|
||||
async _loadPrefs() {
|
||||
// give extension prefs access to their own extension object
|
||||
ExtensionUtils.setCurrentExtension(this._extension);
|
||||
|
||||
const {dir, metadata} = this._extension;
|
||||
|
||||
const prefsJs = dir.get_child('prefs.js');
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {ExtensionPrefsDialog} from './extensionPrefsDialog.js';
|
|||
import {ServiceImplementation} from './dbusService.js';
|
||||
|
||||
const {deserializeExtension} = imports.misc.extensionUtils;
|
||||
const {setExtensionManager} = imports.misc.extensionUtils;
|
||||
const {loadInterfaceXML} = imports.misc.dbusUtils;
|
||||
|
||||
const ExtensionsIface = loadInterfaceXML('org.gnome.Shell.Extensions');
|
||||
|
|
@ -27,6 +28,7 @@ class ExtensionManager {
|
|||
}
|
||||
|
||||
const extensionManager = new ExtensionManager();
|
||||
setExtensionManager(extensionManager);
|
||||
|
||||
export const ExtensionsService = class extends ServiceImplementation {
|
||||
constructor() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue