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) {
for (const option in options)
options[option] = options[option].deep_unpack();
options[option] = options[option].deepUnpack();
if (options['pipeline'] !== undefined)
this._pipelineString = options['pipeline'];

View File

@ -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) {

View File

@ -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;

View File

@ -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();
});

View File

@ -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;

View File

@ -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);
}

View File

@ -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)

View File

@ -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

View File

@ -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);
});
});
}

View File

@ -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()) {

View File

@ -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({

View File

@ -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,

View File

@ -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;

View File

@ -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');

View File

@ -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");
}