[gnome-shell] extensionPrefs: Simplify state change handling
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] extensionPrefs: Simplify state change handling
- Date: Thu, 5 Dec 2019 15:31:18 +0000 (UTC)
commit 2703eed446e7333cd8e1fa5371baf08f72e49c10
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Nov 30 06:01:44 2019 +0100
extensionPrefs: Simplify state change handling
The new `ExtensionStateChanged` signal already passes the changed
extension object, no need to request it again with `GetExtensionInfo`.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/873
js/extensionPrefs/main.js | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/js/extensionPrefs/main.js b/js/extensionPrefs/main.js
index 163d6dbfe7..387f7f325b 100644
--- a/js/extensionPrefs/main.js
+++ b/js/extensionPrefs/main.js
@@ -258,23 +258,15 @@ class Application extends Gtk.Application {
}
_onExtensionStateChanged(proxy, senderName, [uuid, newState]) {
+ let extension = ExtensionUtils.deserializeExtension(newState);
let row = this._findExtensionRow(uuid);
+
if (row) {
- let { state } = ExtensionUtils.deserializeExtension(newState);
- if (state == ExtensionState.UNINSTALLED)
+ if (extension.state === ExtensionState.UNINSTALLED)
row.destroy();
return; // we only deal with new and deleted extensions here
}
-
- this._shellProxy.GetExtensionInfoRemote(uuid, ([serialized]) => {
- let extension = ExtensionUtils.deserializeExtension(serialized);
- if (!extension)
- return;
- // check the extension wasn't added in between
- if (this._findExtensionRow(uuid) != null)
- return;
- this._addExtensionRow(extension);
- });
+ this._addExtensionRow(extension);
}
_scanExtensions() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]