cleanup: Use new indentation style for arrays
We've made some progress on transitioning to the modern indentation style, and for arrays the legacy style is now rare enough to make a bulk transition feasible. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2200>
This commit is contained in:
parent
696965c9f7
commit
ac9fbe92e5
@ -1192,8 +1192,10 @@ var LoginDialog = GObject.registerClass({
|
||||
|
||||
this._updateCancelButton();
|
||||
|
||||
let batch = new Batch.ConcurrentBatch(this, [GdmUtil.cloneAndFadeOutActor(this._userSelectionBox),
|
||||
this._beginVerificationForItem(activatedItem)]);
|
||||
const batch = new Batch.ConcurrentBatch(this, [
|
||||
GdmUtil.cloneAndFadeOutActor(this._userSelectionBox),
|
||||
this._beginVerificationForItem(activatedItem),
|
||||
]);
|
||||
batch.run();
|
||||
}
|
||||
|
||||
|
@ -73,12 +73,13 @@ function waitSignal(object, signal) {
|
||||
}
|
||||
|
||||
function extractBootTimestamp() {
|
||||
let sp = Gio.Subprocess.new(['journalctl', '-b',
|
||||
'MESSAGE_ID=7d4958e842da4a758f6c1cdc7b36dcc5',
|
||||
'UNIT=graphical.target',
|
||||
'-o',
|
||||
'json'],
|
||||
Gio.SubprocessFlags.STDOUT_PIPE);
|
||||
const sp = Gio.Subprocess.new([
|
||||
'journalctl', '-b',
|
||||
'MESSAGE_ID=7d4958e842da4a758f6c1cdc7b36dcc5',
|
||||
'UNIT=graphical.target',
|
||||
'-o',
|
||||
'json',
|
||||
], Gio.SubprocessFlags.STDOUT_PIPE);
|
||||
let result = null;
|
||||
|
||||
let datastream = Gio.DataInputStream.new(sp.get_stdout_pipe());
|
||||
|
@ -425,10 +425,12 @@ var VPNRequestHandler = class {
|
||||
|
||||
let connectionSetting = connection.get_setting_connection();
|
||||
|
||||
let argv = [authHelper.fileName,
|
||||
'-u', connectionSetting.uuid,
|
||||
'-n', connectionSetting.id,
|
||||
'-s', serviceType];
|
||||
const argv = [
|
||||
authHelper.fileName,
|
||||
'-u', connectionSetting.uuid,
|
||||
'-n', connectionSetting.id,
|
||||
'-s', serviceType,
|
||||
];
|
||||
if (authHelper.externalUIMode)
|
||||
argv.push('--external-ui-mode');
|
||||
if (flags & NM.SecretAgentGetSecretsFlags.ALLOW_INTERACTION)
|
||||
|
@ -145,10 +145,12 @@ class TelepathyClient extends Tp.BaseClient {
|
||||
factory.add_account_features([Tp.Account.get_feature_quark_connection()]);
|
||||
factory.add_connection_features([Tp.Connection.get_feature_quark_contact_list()]);
|
||||
factory.add_channel_features([Tp.Channel.get_feature_quark_contacts()]);
|
||||
factory.add_contact_features([Tp.ContactFeature.ALIAS,
|
||||
Tp.ContactFeature.AVATAR_DATA,
|
||||
Tp.ContactFeature.PRESENCE,
|
||||
Tp.ContactFeature.SUBSCRIPTION_STATES]);
|
||||
factory.add_contact_features([
|
||||
Tp.ContactFeature.ALIAS,
|
||||
Tp.ContactFeature.AVATAR_DATA,
|
||||
Tp.ContactFeature.PRESENCE,
|
||||
Tp.ContactFeature.SUBSCRIPTION_STATES,
|
||||
]);
|
||||
|
||||
// Set up a SimpleObserver, which will call _observeChannels whenever a
|
||||
// channel matching its filters is detected.
|
||||
|
@ -8,14 +8,18 @@ const Main = imports.ui.main;
|
||||
|
||||
var MAX_CANDIDATES_PER_PAGE = 16;
|
||||
|
||||
var DEFAULT_INDEX_LABELS = ['1', '2', '3', '4', '5', '6', '7', '8',
|
||||
'9', '0', 'a', 'b', 'c', 'd', 'e', 'f'];
|
||||
var DEFAULT_INDEX_LABELS = [
|
||||
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
|
||||
'a', 'b', 'c', 'd', 'e', 'f',
|
||||
];
|
||||
|
||||
var CandidateArea = GObject.registerClass({
|
||||
Signals: {
|
||||
'candidate-clicked': { param_types: [GObject.TYPE_UINT,
|
||||
GObject.TYPE_UINT,
|
||||
Clutter.ModifierType.$gtype] },
|
||||
'candidate-clicked': {
|
||||
param_types: [
|
||||
GObject.TYPE_UINT, GObject.TYPE_UINT, Clutter.ModifierType.$gtype,
|
||||
],
|
||||
},
|
||||
'cursor-down': {},
|
||||
'cursor-up': {},
|
||||
'next-page': {},
|
||||
|
@ -802,8 +802,10 @@ var ZoomRegion = class ZoomRegion {
|
||||
}
|
||||
|
||||
let scaleFactor = St.ThemeContext.get_for_stage(global.stage).scale_factor;
|
||||
let [xFocus, yFocus] = [(extents.x + (extents.width / 2)) * scaleFactor,
|
||||
(extents.y + (extents.height / 2)) * scaleFactor];
|
||||
const [xFocus, yFocus] = [
|
||||
(extents.x + (extents.width / 2)) * scaleFactor,
|
||||
(extents.y + (extents.height / 2)) * scaleFactor,
|
||||
];
|
||||
|
||||
if (this._xFocus !== xFocus || this._yFocus !== yFocus) {
|
||||
[this._xFocus, this._yFocus] = [xFocus, yFocus];
|
||||
@ -997,9 +999,11 @@ var ZoomRegion = class ZoomRegion {
|
||||
let roiWidth = this._viewPortWidth / this._xMagFactor;
|
||||
let roiHeight = this._viewPortHeight / this._yMagFactor;
|
||||
|
||||
return [this._xCenter - roiWidth / 2,
|
||||
this._yCenter - roiHeight / 2,
|
||||
roiWidth, roiHeight];
|
||||
return [
|
||||
this._xCenter - roiWidth / 2,
|
||||
this._yCenter - roiHeight / 2,
|
||||
roiWidth, roiHeight,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1580,8 +1584,10 @@ var ZoomRegion = class ZoomRegion {
|
||||
_screenToViewPort(screenX, screenY) {
|
||||
// Converts coordinates relative to the (unmagnified) screen to coordinates
|
||||
// relative to the origin of this._magView
|
||||
return [this._viewPortWidth / 2 + (screenX - this._xCenter) * this._xMagFactor,
|
||||
this._viewPortHeight / 2 + (screenY - this._yCenter) * this._yMagFactor];
|
||||
return [
|
||||
this._viewPortWidth / 2 + (screenX - this._xCenter) * this._xMagFactor,
|
||||
this._viewPortHeight / 2 + (screenY - this._yCenter) * this._yMagFactor,
|
||||
];
|
||||
}
|
||||
|
||||
_updateMagViewGeometry() {
|
||||
|
@ -192,16 +192,20 @@ class ScaleLayout extends Clutter.BinLayout {
|
||||
this._connectContainer(container);
|
||||
|
||||
let [min, nat] = super.vfunc_get_preferred_width(container, forHeight);
|
||||
return [Math.floor(min * container.scale_x),
|
||||
Math.floor(nat * container.scale_x)];
|
||||
return [
|
||||
Math.floor(min * container.scale_x),
|
||||
Math.floor(nat * container.scale_x),
|
||||
];
|
||||
}
|
||||
|
||||
vfunc_get_preferred_height(container, forWidth) {
|
||||
this._connectContainer(container);
|
||||
|
||||
let [min, nat] = super.vfunc_get_preferred_height(container, forWidth);
|
||||
return [Math.floor(min * container.scale_y),
|
||||
Math.floor(nat * container.scale_y)];
|
||||
return [
|
||||
Math.floor(min * container.scale_y),
|
||||
Math.floor(nat * container.scale_y),
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
@ -275,10 +279,14 @@ var LabelExpanderLayout = GObject.registerClass({
|
||||
|
||||
if (children[1]) {
|
||||
let [min2, nat2] = children[1].get_preferred_height(forWidth);
|
||||
let [expMin, expNat] = [Math.min(min2, min * this._expandLines),
|
||||
Math.min(nat2, nat * this._expandLines)];
|
||||
[min, nat] = [min + this._expansion * (expMin - min),
|
||||
nat + this._expansion * (expNat - nat)];
|
||||
const [expMin, expNat] = [
|
||||
Math.min(min2, min * this._expandLines),
|
||||
Math.min(nat2, nat * this._expandLines),
|
||||
];
|
||||
[min, nat] = [
|
||||
min + this._expansion * (expMin - min),
|
||||
nat + this._expansion * (expNat - nat),
|
||||
];
|
||||
}
|
||||
|
||||
return [min, nat];
|
||||
|
@ -43,8 +43,10 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
||||
|
||||
_imageForNotificationData(hints) {
|
||||
if (hints['image-data']) {
|
||||
let [width, height, rowStride, hasAlpha,
|
||||
bitsPerSample, nChannels_, data] = hints['image-data'];
|
||||
const [
|
||||
width, height, rowStride, hasAlpha,
|
||||
bitsPerSample, nChannels_, data,
|
||||
] = hints['image-data'];
|
||||
return Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha,
|
||||
bitsPerSample, width, height, rowStride);
|
||||
} else if (hints['image-path']) {
|
||||
@ -195,9 +197,8 @@ var FdoNotificationDaemon = class FdoNotificationDaemon {
|
||||
}
|
||||
|
||||
_notifyForSource(source, ndata) {
|
||||
let [id_, icon, summary, body, actions, hints, notification] =
|
||||
[ndata.id, ndata.icon, ndata.summary, ndata.body,
|
||||
ndata.actions, ndata.hints, ndata.notification];
|
||||
const { icon, summary, body, actions, hints } = ndata;
|
||||
let { notification } = ndata;
|
||||
|
||||
if (notification == null) {
|
||||
notification = new MessageTray.Notification(source);
|
||||
|
@ -221,8 +221,10 @@ var RemoteSearchProvider = class {
|
||||
} else if (meta['gicon']) {
|
||||
gicon = Gio.icon_new_for_string(meta['gicon']);
|
||||
} else if (meta['icon-data']) {
|
||||
let [width, height, rowStride, hasAlpha,
|
||||
bitsPerSample, nChannels_, data] = meta['icon-data'];
|
||||
const [
|
||||
width, height, rowStride, hasAlpha,
|
||||
bitsPerSample, nChannels_, data,
|
||||
] = meta['icon-data'];
|
||||
gicon = Shell.util_create_pixbuf_from_data(data, GdkPixbuf.Colorspace.RGB, hasAlpha,
|
||||
bitsPerSample, width, height, rowStride);
|
||||
}
|
||||
|
@ -11,6 +11,14 @@ const Config = imports.misc.config;
|
||||
|
||||
const DEFAULT_MODE = 'restrictive';
|
||||
|
||||
const USER_SESSION_COMPONENTS = [
|
||||
'polkitAgent', 'telepathyClient', 'keyring',
|
||||
'autorunManager', 'automountManager',
|
||||
];
|
||||
|
||||
if (Config.HAVE_NETWORKMANAGER)
|
||||
USER_SESSION_COMPONENTS.push('networkAgent');
|
||||
|
||||
const _modes = {
|
||||
'restrictive': {
|
||||
parentMode: null,
|
||||
@ -82,12 +90,7 @@ const _modes = {
|
||||
isLocked: false,
|
||||
isPrimary: true,
|
||||
unlockDialog: imports.ui.unlockDialog.UnlockDialog,
|
||||
components: Config.HAVE_NETWORKMANAGER
|
||||
? ['networkAgent', 'polkitAgent', 'telepathyClient',
|
||||
'keyring', 'autorunManager', 'automountManager']
|
||||
: ['polkitAgent', 'telepathyClient',
|
||||
'keyring', 'autorunManager', 'automountManager'],
|
||||
|
||||
components: USER_SESSION_COMPONENTS,
|
||||
panel: {
|
||||
left: ['activities', 'appMenu'],
|
||||
center: ['dateMenu'],
|
||||
|
@ -254,12 +254,18 @@ var ShellMountQuestionDialog = GObject.registerClass({
|
||||
});
|
||||
|
||||
var ShellMountPasswordDialog = GObject.registerClass({
|
||||
Signals: { 'response': { param_types: [GObject.TYPE_INT,
|
||||
GObject.TYPE_STRING,
|
||||
GObject.TYPE_BOOLEAN,
|
||||
GObject.TYPE_BOOLEAN,
|
||||
GObject.TYPE_BOOLEAN,
|
||||
GObject.TYPE_UINT] } },
|
||||
Signals: {
|
||||
'response': {
|
||||
param_types: [
|
||||
GObject.TYPE_INT,
|
||||
GObject.TYPE_STRING,
|
||||
GObject.TYPE_BOOLEAN,
|
||||
GObject.TYPE_BOOLEAN,
|
||||
GObject.TYPE_BOOLEAN,
|
||||
GObject.TYPE_UINT,
|
||||
],
|
||||
},
|
||||
},
|
||||
}, class ShellMountPasswordDialog extends ModalDialog.ModalDialog {
|
||||
_init(message, flags) {
|
||||
let strings = message.split('\n');
|
||||
|
@ -795,16 +795,20 @@ class InputSourceIndicatorContainer extends St.Widget {
|
||||
// for those we don't actually display.
|
||||
return this.get_children().reduce((maxWidth, child) => {
|
||||
let width = child.get_preferred_width(forHeight);
|
||||
return [Math.max(maxWidth[0], width[0]),
|
||||
Math.max(maxWidth[1], width[1])];
|
||||
return [
|
||||
Math.max(maxWidth[0], width[0]),
|
||||
Math.max(maxWidth[1], width[1]),
|
||||
];
|
||||
}, [0, 0]);
|
||||
}
|
||||
|
||||
vfunc_get_preferred_height(forWidth) {
|
||||
return this.get_children().reduce((maxHeight, child) => {
|
||||
let height = child.get_preferred_height(forWidth);
|
||||
return [Math.max(maxHeight[0], height[0]),
|
||||
Math.max(maxHeight[1], height[1])];
|
||||
return [
|
||||
Math.max(maxHeight[0], height[0]),
|
||||
Math.max(maxHeight[1], height[1]),
|
||||
];
|
||||
}, [0, 0]);
|
||||
}
|
||||
|
||||
|
@ -1752,9 +1752,11 @@ class Indicator extends PanelMenu.SystemIndicator {
|
||||
this._nmDevices = [];
|
||||
this._devices = { };
|
||||
|
||||
let categories = [NMConnectionCategory.WIRED,
|
||||
NMConnectionCategory.WIRELESS,
|
||||
NMConnectionCategory.WWAN];
|
||||
const categories = [
|
||||
NMConnectionCategory.WIRED,
|
||||
NMConnectionCategory.WIRELESS,
|
||||
NMConnectionCategory.WWAN,
|
||||
];
|
||||
for (let category of categories) {
|
||||
this._devices[category] = new DeviceCategory(category);
|
||||
this.menu.addMenuItem(this._devices[category]);
|
||||
|
@ -1135,9 +1135,11 @@ var WindowManager = class {
|
||||
}
|
||||
|
||||
_minimizeWindow(shellwm, actor) {
|
||||
let types = [Meta.WindowType.NORMAL,
|
||||
Meta.WindowType.MODAL_DIALOG,
|
||||
Meta.WindowType.DIALOG];
|
||||
const types = [
|
||||
Meta.WindowType.NORMAL,
|
||||
Meta.WindowType.MODAL_DIALOG,
|
||||
Meta.WindowType.DIALOG,
|
||||
];
|
||||
if (!this._shouldAnimateActor(actor, types)) {
|
||||
shellwm.completed_minimize(actor);
|
||||
return;
|
||||
@ -1200,9 +1202,11 @@ var WindowManager = class {
|
||||
}
|
||||
|
||||
_unminimizeWindow(shellwm, actor) {
|
||||
let types = [Meta.WindowType.NORMAL,
|
||||
Meta.WindowType.MODAL_DIALOG,
|
||||
Meta.WindowType.DIALOG];
|
||||
const types = [
|
||||
Meta.WindowType.NORMAL,
|
||||
Meta.WindowType.MODAL_DIALOG,
|
||||
Meta.WindowType.DIALOG,
|
||||
];
|
||||
if (!this._shouldAnimateActor(actor, types)) {
|
||||
shellwm.completed_unminimize(actor);
|
||||
return;
|
||||
@ -1467,9 +1471,11 @@ var WindowManager = class {
|
||||
if (actor.meta_window.is_attached_dialog())
|
||||
this._checkDimming(actor.get_meta_window().get_transient_for());
|
||||
|
||||
let types = [Meta.WindowType.NORMAL,
|
||||
Meta.WindowType.DIALOG,
|
||||
Meta.WindowType.MODAL_DIALOG];
|
||||
const types = [
|
||||
Meta.WindowType.NORMAL,
|
||||
Meta.WindowType.DIALOG,
|
||||
Meta.WindowType.MODAL_DIALOG,
|
||||
];
|
||||
if (!this._shouldAnimateActor(actor, types)) {
|
||||
shellwm.completed_map(actor);
|
||||
return;
|
||||
@ -1544,9 +1550,11 @@ var WindowManager = class {
|
||||
if (window.is_attached_dialog())
|
||||
this._checkDimming(window.get_transient_for());
|
||||
|
||||
let types = [Meta.WindowType.NORMAL,
|
||||
Meta.WindowType.DIALOG,
|
||||
Meta.WindowType.MODAL_DIALOG];
|
||||
const types = [
|
||||
Meta.WindowType.NORMAL,
|
||||
Meta.WindowType.DIALOG,
|
||||
Meta.WindowType.MODAL_DIALOG,
|
||||
];
|
||||
if (!this._shouldAnimateActor(actor, types)) {
|
||||
shellwm.completed_destroy(actor);
|
||||
return;
|
||||
|
@ -7,7 +7,6 @@ rules:
|
||||
- 'CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child'
|
||||
CallExpression:
|
||||
arguments: first
|
||||
ArrayExpression: first
|
||||
ObjectExpression: first
|
||||
MemberExpression: off
|
||||
jsdoc/check-alignment: off
|
||||
|
Loading…
Reference in New Issue
Block a user