From c343e1d65ddc538972640e7da86429cbd4cf2829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 21 Feb 2024 15:58:39 +0100 Subject: [PATCH 08/28] workspace-indicator: Don't use SCHEMA/KEY constants Each constant is only used once, so all they do is disconnect the actual value from the code that uses it. The copy in the window-list extension just uses the strings directly, do the same here. Part-of: --- extensions/workspace-indicator/workspaceIndicator.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/extensions/workspace-indicator/workspaceIndicator.js b/extensions/workspace-indicator/workspaceIndicator.js index cdcc67fe..fe54b95c 100644 --- a/extensions/workspace-indicator/workspaceIndicator.js +++ b/extensions/workspace-indicator/workspaceIndicator.js @@ -17,9 +17,6 @@ import * as Main from 'resource:///org/gnome/shell/ui/main.js'; import * as PanelMenu from 'resource:///org/gnome/shell/ui/panelMenu.js'; import * as PopupMenu from 'resource:///org/gnome/shell/ui/popupMenu.js'; -const WORKSPACE_SCHEMA = 'org.gnome.desktop.wm.preferences'; -const WORKSPACE_KEY = 'workspace-names'; - const TOOLTIP_OFFSET = 6; const TOOLTIP_ANIMATION_TIME = 150; @@ -310,9 +307,10 @@ export class WorkspaceIndicator extends PanelMenu.Button { this._updateThumbnails(); this._updateThumbnailVisibility(); - this._settings = new Gio.Settings({schema_id: WORKSPACE_SCHEMA}); - this._settings.connectObject(`changed::${WORKSPACE_KEY}`, - this._updateMenuLabels.bind(this), this); + const desktopSettings = + new Gio.Settings({schema_id: 'org.gnome.desktop.wm.preferences'}); + desktopSettings.connectObject('changed::workspace-names', + () => this._updateMenuLabels(), this); } _onDestroy() { -- 2.44.0