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] 13e662a29d

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2416>
This commit is contained in:
Alessandro Bono 2022-08-10 11:56:14 +02:00 committed by Marge Bot
parent ade4b23796
commit b63c6ac0ef
15 changed files with 20 additions and 20 deletions

View File

@ -76,7 +76,7 @@ var Recorder = class {
_applyOptions(options) { _applyOptions(options) {
for (const option in options) for (const option in options)
options[option] = options[option].deep_unpack(); options[option] = options[option].deepUnpack();
if (options['pipeline'] !== undefined) if (options['pipeline'] !== undefined)
this._pipelineString = options['pipeline']; this._pipelineString = options['pipeline'];

View File

@ -587,7 +587,7 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
if (!this.serviceIsForeground(serviceName)) if (!this.serviceIsForeground(serviceName))
return; return;
this.emit('show-choice-list', serviceName, promptMessage, list.deep_unpack()); this.emit('show-choice-list', serviceName, promptMessage, list.deepUnpack());
} }
_onInfo(client, serviceName, info) { _onInfo(client, serviceName, info) {

View File

@ -42,7 +42,7 @@ function canLock() {
Gio.DBusCallFlags.NONE, Gio.DBusCallFlags.NONE,
-1, null); -1, null);
let version = result.deep_unpack()[0].deep_unpack(); let version = result.deepUnpack()[0].deepUnpack();
return haveSystemd() && versionCompare('3.5.91', version); return haveSystemd() && versionCompare('3.5.91', version);
} catch (e) { } catch (e) {
return false; return false;

View File

@ -250,14 +250,14 @@ var BroadbandModem = GObject.registerClass({
this._reloadSignalQuality(); this._reloadSignalQuality();
this._proxy_3gpp.connect('g-properties-changed', (proxy, properties) => { 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) if ('OperatorName' in unpacked || 'OperatorCode' in unpacked)
this._reload3gppOperatorName(); this._reload3gppOperatorName();
}); });
this._reload3gppOperatorName(); this._reload3gppOperatorName();
this._proxy_cdma.connect('g-properties-changed', (proxy, properties) => { 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) if ('Nid' in unpacked || 'Sid' in unpacked)
this._reloadCdmaOperatorName(); this._reloadCdmaOperatorName();
}); });

View File

@ -294,7 +294,7 @@ var WeatherClient = class extends Signals.EventEmitter {
} }
_onLocationsChanged() { _onLocationsChanged() {
let locations = this._settings.get_value('locations').deep_unpack(); let locations = this._settings.get_value('locations').deepUnpack();
let serialized = locations.shift(); let serialized = locations.shift();
let mostRecentLocation = null; let mostRecentLocation = null;

View File

@ -28,7 +28,7 @@ class AccessDialog extends ModalDialog.ModalDialog {
this._request = Gio.DBusExportedObject.wrapJSObject(RequestIface, this); this._request = Gio.DBusExportedObject.wrapJSObject(RequestIface, this);
for (let option in options) for (let option in options)
options[option] = options[option].deep_unpack(); options[option] = options[option].deepUnpack();
this._buildLayout(title, description, body, options); this._buildLayout(title, description, body, options);
} }

View File

@ -375,7 +375,7 @@ class WorldClocksSection extends St.Button {
this._locations = []; this._locations = [];
let world = GWeather.Location.get_world(); 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++) { for (let i = 0; i < clocks.length; i++) {
let l = world.deserialize(clocks[i]); let l = world.deserialize(clocks[i]);
if (l && l.get_timezone() != null) if (l && l.get_timezone() != null)

View File

@ -187,7 +187,7 @@ var MprisPlayer = class MprisPlayer extends Signals.EventEmitter {
_updateState() { _updateState() {
let metadata = {}; let metadata = {};
for (let prop in this._playerProxy.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: // Validate according to the spec; some clients send buggy metadata:
// https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata // https://www.freedesktop.org/wiki/Specifications/mpris-spec/metadata

View File

@ -130,7 +130,7 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
for (let hint in hints) { for (let hint in hints) {
// unpack the variants // unpack the variants
hints[hint] = hints[hint].deep_unpack(); hints[hint] = hints[hint].deepUnpack();
} }
hints = Params.parse(hints, { urgency: Urgency.NORMAL }, true); hints = Params.parse(hints, { urgency: Urgency.NORMAL }, true);
@ -488,7 +488,7 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
} }
if (buttons) { if (buttons) {
buttons.deep_unpack().forEach(button => { buttons.deepUnpack().forEach(button => {
this.addAction(button.label.unpack(), () => { this.addAction(button.label.unpack(), () => {
this._onButtonClicked(button); this._onButtonClicked(button);
}); });
@ -691,7 +691,7 @@ var GtkNotificationDaemon = class GtkNotificationDaemon {
try { try {
let value = global.get_persistent_state('a(sa(sv))', 'notifications'); let value = global.get_persistent_state('a(sa(sv))', 'notifications');
if (value) { if (value) {
let sources = value.deep_unpack(); let sources = value.deepUnpack();
sources.forEach(([appId, notifications]) => { sources.forEach(([appId, notifications]) => {
if (notifications.length == 0) if (notifications.length == 0)
return; return;
@ -706,7 +706,7 @@ var GtkNotificationDaemon = class GtkNotificationDaemon {
} }
notifications.forEach(([notificationId, notification]) => { notifications.forEach(([notificationId, notification]) => {
source.addNotification(notificationId, notification.deep_unpack(), false); source.addNotification(notificationId, notification.deepUnpack(), false);
}); });
}); });
} }

View File

@ -99,7 +99,7 @@ var OsdMonitorLabeler = class {
let monitor = this._monitorManager.get_monitor_for_connector(connector); let monitor = this._monitorManager.get_monitor_for_connector(connector);
if (monitor == -1) if (monitor == -1)
continue; 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()) { for (let [monitor, labels] of this._monitorLabels.entries()) {

View File

@ -287,7 +287,7 @@ var RemoteSearchProvider = class {
for (let prop in metas[i]) { for (let prop in metas[i]) {
// we can use the serialized icon variant directly // we can use the serialized icon variant directly
if (prop !== 'icon') if (prop !== 'icon')
metas[i][prop] = metas[i][prop].deep_unpack(); metas[i][prop] = metas[i][prop].deepUnpack();
} }
resultMetas.push({ resultMetas.push({

View File

@ -115,7 +115,7 @@ var GnomeShell = class {
} }
for (let param in params) for (let param in params)
params[param] = params[param].deep_unpack(); params[param] = params[param].deepUnpack();
const { const {
connector, connector,

View File

@ -211,7 +211,7 @@ var InputSourceSystemSettings = class extends InputSourceSettings {
'GetAll', 'GetAll',
new GLib.Variant('(s)', [this._BUS_IFACE]), new GLib.Variant('(s)', [this._BUS_IFACE]),
null, Gio.DBusCallFlags.NONE, -1, null); null, Gio.DBusCallFlags.NONE, -1, null);
[props] = result.deep_unpack(); [props] = result.deepUnpack();
} catch (e) { } catch (e) {
log(`Could not get properties from ${this._BUS_NAME}`); log(`Could not get properties from ${this._BUS_NAME}`);
return; return;
@ -274,7 +274,7 @@ var InputSourceSessionSettings = class extends InputSourceSettings {
let nSources = sources.n_children(); let nSources = sources.n_children();
for (let i = 0; i < nSources; i++) { 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 }); sourcesList.push({ type, id });
} }
return sourcesList; return sourcesList;

View File

@ -63,7 +63,7 @@ const RfkillManager = GObject.registerClass({
/* eslint-enable camelcase */ /* eslint-enable camelcase */
_changed(proxy, properties) { _changed(proxy, properties) {
for (const prop in properties.deep_unpack()) { for (const prop in properties.deepUnpack()) {
switch (prop) { switch (prop) {
case 'AirplaneMode': case 'AirplaneMode':
this.notify('airplane-mode'); this.notify('airplane-mode');

View File

@ -13,7 +13,7 @@ function do_action_param(action, parameter) {
} }
function do_action_toggle(action) { 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"); print ("Toggled");
} }