Update: Don't create object as result of init() being called

Create `this.settings` on enable instead of on init/creation, so that no
objects get created as a result of `init()` being called.

See here for the relevant review:
https://extensions.gnome.org/review/25308
And for the relevant documentation:
https://wiki.gnome.org/Projects/GnomeShell/Extensions/Review#Only_use_.60init.28.29.60_for_initialization
This commit is contained in:
Julian 2021-06-21 18:46:34 +02:00
parent 569fc6a683
commit 49c46bf33f
Signed by: julian
GPG Key ID: 094C2AC34192FA11

View File

@ -30,10 +30,11 @@ const BoxOrderCreator = Me.imports.extensionModules.BoxOrderCreator;
class Extension {
constructor() {
this.settings = ExtensionUtils.getSettings();
}
enable() {
this.settings = ExtensionUtils.getSettings();
// Create an instance of AppIndicatorKStatusNotifierItemManager to handle AppIndicator/KStatusNotifierItem items.
this._appIndicatorKStatusNotifierItemManager = new AppIndicatorKStatusNotifierItemManager.AppIndicatorKStatusNotifierItemManager();