[gnome-shell] cleanup: Use deepUnpack() intead of deep_unpack()



commit b63c6ac0efe1bfbcdfcb872ce28784a7cd397d83
Author: Alessandro Bono <alessandro bono369 gmail com>
Date:   Wed Aug 10 11:56:14 2022 +0200

    cleanup: Use deepUnpack() intead of deep_unpack()
    
    deep_unpack() is just a backwards compability alias for deepUnpack()[1].
    The new name makes it more clear that this is not a C function, start to
    use it.
    
    [1] https://gitlab.gnome.org/GNOME/gjs/-/commit/13e662a29dbc762d5f4245c504f1e058788b516e
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2416>

 js/dbusServices/screencast/screencastService.js | 2 +-
 js/gdm/util.js                                  | 2 +-
 js/misc/loginManager.js                         | 2 +-
 js/misc/modemManager.js                         | 4 ++--
 js/misc/weather.js                              | 2 +-
 js/ui/accessDialog.js                           | 2 +-
 js/ui/dateMenu.js                               | 2 +-
 js/ui/mpris.js                                  | 2 +-
 js/ui/notificationDaemon.js                     | 8 ++++----
 js/ui/osdMonitorLabeler.js                      | 2 +-
 js/ui/remoteSearch.js                           | 2 +-
 js/ui/shellDBus.js                              | 2 +-
 js/ui/status/keyboard.js                        | 4 ++--
 js/ui/status/rfkill.js                          | 2 +-
 tests/interactive/gapplication.js               | 2 +-
 15 files changed, 20 insertions(+), 20 deletions(-)
---
diff --git a/js/dbusServices/screencast/screencastService.js b/js/dbusServices/screencast/screencastService.js
index 6f348c9d9c..75ffba7c21 100644
--- a/js/dbusServices/screencast/screencastService.js
+++ b/js/dbusServices/screencast/screencastService.js
@@ -76,7 +76,7 @@ var Recorder = class {
 
     _applyOptions(options) {
         for (const option in options)
-            options[option] = options[option].deep_unpack();
+            options[option] = options[option].deepUnpack();
 
         if (options['pipeline'] !== undefined)
             this._pipelineString = options['pipeline'];
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 22cbe47339..43647e7ac9 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -587,7 +587,7 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
         if (!this.serviceIsForeground(serviceName))
             return;
 
-        this.emit('show-choice-list', serviceName, promptMessage, list.deep_unpack());
+        this.emit('show-choice-list', serviceName, promptMessage, list.deepUnpack());
     }
 
     _onInfo(client, serviceName, info) {
diff --git a/js/misc/loginManager.js b/js/misc/loginManager.js
index fb61d64cb5..6549fe5adc 100644
--- a/js/misc/loginManager.js
+++ b/js/misc/loginManager.js
@@ -42,7 +42,7 @@ function canLock() {
                                                Gio.DBusCallFlags.NONE,
                                                -1, null);
 
-        let version = result.deep_unpack()[0].deep_unpack();
+        let version = result.deepUnpack()[0].deepUnpack();
         return haveSystemd() && versionCompare('3.5.91', version);
     } catch (e) {
         return false;
diff --git a/js/misc/modemManager.js b/js/misc/modemManager.js
index 0424b77ff9..3c29795772 100644
--- a/js/misc/modemManager.js
+++ b/js/misc/modemManager.js
@@ -250,14 +250,14 @@ var BroadbandModem = GObject.registerClass({
         this._reloadSignalQuality();
 
         this._proxy_3gpp.connect('g-properties-changed', (proxy, properties) => {
-            let unpacked = properties.deep_unpack();
+            let unpacked = properties.deepUnpack();
             if ('OperatorName' in unpacked || 'OperatorCode' in unpacked)
                 this._reload3gppOperatorName();
         });
         this._reload3gppOperatorName();
 
         this._proxy_cdma.connect('g-properties-changed', (proxy, properties) => {
-            let unpacked = properties.deep_unpack();
+            let unpacked = properties.deepUnpack();
             if ('Nid' in unpacked || 'Sid' in unpacked)
                 this._reloadCdmaOperatorName();
         });
diff --git a/js/misc/weather.js b/js/misc/weather.js
index 3f05f21fe1..a01b832b8f 100644
--- a/js/misc/weather.js
+++ b/js/misc/weather.js
@@ -294,7 +294,7 @@ var WeatherClient = class extends Signals.EventEmitter {
     }
 
     _onLocationsChanged() {
-        let locations = this._settings.get_value('locations').deep_unpack();
+        let locations = this._settings.get_value('locations').deepUnpack();
         let serialized = locations.shift();
         let mostRecentLocation = null;
 
diff --git a/js/ui/accessDialog.js b/js/ui/accessDialog.js
index a162d65016..8788e47428 100644
--- a/js/ui/accessDialog.js
+++ b/js/ui/accessDialog.js
@@ -28,7 +28,7 @@ class AccessDialog extends ModalDialog.ModalDialog {
         this._request = Gio.DBusExportedObject.wrapJSObject(RequestIface, this);
 
         for (let option in options)
-            options[option] = options[option].deep_unpack();
+            options[option] = options[option].deepUnpack();
 
         this._buildLayout(title, description, body, options);
     }
diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js
index bd363f3232..2c44f0c4fb 100644
--- a/js/ui/dateMenu.js
+++ b/js/ui/dateMenu.js
@@ -375,7 +375,7 @@ class WorldClocksSection extends St.Button {
         this._locations = [];
 
         let world = GWeather.Location.get_world();
-        let clocks = this._settings.get_value('locations').deep_unpack();
+        let clocks = this._settings.get_value('locations').deepUnpack();
         for (let i = 0; i < clocks.length; i++) {
             let l = world.deserialize(clocks[i]);
             if (l && l.get_timezone() != null)
diff --git a/js/ui/mpris.js b/js/ui/mpris.js
index 3ef8ef399d..f44f87e92c 100644
--- a/js/ui/mpris.js
+++ b/js/ui/mpris.js
@@ -187,7 +187,7 @@ var MprisPlayer = class MprisPlayer extends Signals.EventEmitter {
     _updateState() {
         let metadata = {};
         for (let prop in this._playerProxy.Metadata)
-            metadata[prop] = this._playerProxy.Metadata[prop].deep_unpack();
+            metadata[prop] = this._playerProxy.Metadata[prop].deepUnpack();
 
         // Validate according to the spec; some clients send buggy metadata:
         // https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index f5e9cee19a..b27158e4f5 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -130,7 +130,7 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
 
         for (let hint in hints) {
             // unpack the variants
-            hints[hint] = hints[hint].deep_unpack();
+            hints[hint] = hints[hint].deepUnpack();
         }
 
         hints = Params.parse(hints, { urgency: Urgency.NORMAL }, true);
@@ -488,7 +488,7 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
         }
 
         if (buttons) {
-            buttons.deep_unpack().forEach(button => {
+            buttons.deepUnpack().forEach(button => {
                 this.addAction(button.label.unpack(), () => {
                     this._onButtonClicked(button);
                 });
@@ -691,7 +691,7 @@ var GtkNotificationDaemon = class GtkNotificationDaemon {
         try {
             let value = global.get_persistent_state('a(sa(sv))', 'notifications');
             if (value) {
-                let sources = value.deep_unpack();
+                let sources = value.deepUnpack();
                 sources.forEach(([appId, notifications]) => {
                     if (notifications.length == 0)
                         return;
@@ -706,7 +706,7 @@ var GtkNotificationDaemon = class GtkNotificationDaemon {
                     }
 
                     notifications.forEach(([notificationId, notification]) => {
-                        source.addNotification(notificationId, notification.deep_unpack(), false);
+                        source.addNotification(notificationId, notification.deepUnpack(), false);
                     });
                 });
             }
diff --git a/js/ui/osdMonitorLabeler.js b/js/ui/osdMonitorLabeler.js
index 540af75ad3..07c7d65692 100644
--- a/js/ui/osdMonitorLabeler.js
+++ b/js/ui/osdMonitorLabeler.js
@@ -99,7 +99,7 @@ var OsdMonitorLabeler = class {
             let monitor = this._monitorManager.get_monitor_for_connector(connector);
             if (monitor == -1)
                 continue;
-            this._monitorLabels.get(monitor).push(params[connector].deep_unpack());
+            this._monitorLabels.get(monitor).push(params[connector].deepUnpack());
         }
 
         for (let [monitor, labels] of this._monitorLabels.entries()) {
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index ec13be673d..87ee3840a3 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -287,7 +287,7 @@ var RemoteSearchProvider = class {
             for (let prop in metas[i]) {
                 // we can use the serialized icon variant directly
                 if (prop !== 'icon')
-                    metas[i][prop] = metas[i][prop].deep_unpack();
+                    metas[i][prop] = metas[i][prop].deepUnpack();
             }
 
             resultMetas.push({
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
index edc16eb872..284d92b0b3 100644
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
@@ -115,7 +115,7 @@ var GnomeShell = class {
         }
 
         for (let param in params)
-            params[param] = params[param].deep_unpack();
+            params[param] = params[param].deepUnpack();
 
         const {
             connector,
diff --git a/js/ui/status/keyboard.js b/js/ui/status/keyboard.js
index 7d6d5fdca0..76a42f6bd7 100644
--- a/js/ui/status/keyboard.js
+++ b/js/ui/status/keyboard.js
@@ -211,7 +211,7 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
                 'GetAll',
                 new GLib.Variant('(s)', [this._BUS_IFACE]),
                 null, Gio.DBusCallFlags.NONE, -1, null);
-            [props] = result.deep_unpack();
+            [props] = result.deepUnpack();
         } catch (e) {
             log(`Could not get properties from ${this._BUS_NAME}`);
             return;
@@ -274,7 +274,7 @@ var InputSourceSessionSettings = class extends InputSourceSettings {
         let nSources = sources.n_children();
 
         for (let i = 0; i < nSources; i++) {
-            let [type, id] = sources.get_child_value(i).deep_unpack();
+            let [type, id] = sources.get_child_value(i).deepUnpack();
             sourcesList.push({ type, id });
         }
         return sourcesList;
diff --git a/js/ui/status/rfkill.js b/js/ui/status/rfkill.js
index 08271c021b..2e1f98f4d5 100644
--- a/js/ui/status/rfkill.js
+++ b/js/ui/status/rfkill.js
@@ -63,7 +63,7 @@ const RfkillManager = GObject.registerClass({
     /* eslint-enable camelcase */
 
     _changed(proxy, properties) {
-        for (const prop in properties.deep_unpack()) {
+        for (const prop in properties.deepUnpack()) {
             switch (prop) {
             case 'AirplaneMode':
                 this.notify('airplane-mode');
diff --git a/tests/interactive/gapplication.js b/tests/interactive/gapplication.js
index ec38b806f3..9dd2a408b3 100755
--- a/tests/interactive/gapplication.js
+++ b/tests/interactive/gapplication.js
@@ -13,7 +13,7 @@ function do_action_param(action, parameter) {
 }
 
 function do_action_toggle(action) {
-    action.set_state(GLib.Variant.new('b', !action.state.deep_unpack()));
+    action.set_state(GLib.Variant.new('b', !action.state.deepUnpack()));
     print ("Toggled");
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]