js: Fix linting errors from line shifts

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2794>
This commit is contained in:
Evan Welsh 2023-06-07 21:53:07 -07:00
parent 1e9b906cbc
commit 0705c7a4eb
20 changed files with 47 additions and 41 deletions

View File

@ -188,10 +188,10 @@ var AuthPrompt = GObject.registerClass({
this._entry = null;
this._textEntry = new St.Entry(entryParams);
ShellEntry.addContextMenu(this._textEntry, { actionMode: Shell.ActionMode.NONE });
ShellEntry.addContextMenu(this._textEntry, {actionMode: Shell.ActionMode.NONE});
this._passwordEntry = new St.PasswordEntry(entryParams);
ShellEntry.addContextMenu(this._passwordEntry, { actionMode: Shell.ActionMode.NONE });
ShellEntry.addContextMenu(this._passwordEntry, {actionMode: Shell.ActionMode.NONE});
this._entry = this._passwordEntry;
this._mainBox.add_child(this._entry);

View File

@ -534,7 +534,7 @@ var ShellUserVerifier = class extends Signals.EventEmitter {
}
serviceIsForeground(serviceName) {
return serviceName == this._getForegroundService();
return serviceName === this._getForegroundService();
}
foregroundServiceDeterminesUsername() {

View File

@ -8,12 +8,16 @@ const NMA4 = imports.gi.NMA4;
const { loadInterfaceXML } = imports.misc.fileUtils;
// _getMobileProvidersDatabase:
//
// Gets the database of mobile providers, with references between MCCMNC/SID and
// operator name
//
let _mpd;
/**
* _getMobileProvidersDatabase:
*
* Gets the database of mobile providers, with references between MCCMNC/SID and
* operator name
*
* @returns {NMA4.MobileProvidersDatabase | null}
*/
function _getMobileProvidersDatabase() {
if (_mpd == null) {
try {

View File

@ -148,9 +148,9 @@ const SystemActions = GObject.registerClass({
available: true,
});
this._loginScreenSettings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
this._lockdownSettings = new Gio.Settings({ schema_id: LOCKDOWN_SCHEMA });
this._orientationSettings = new Gio.Settings({ schema_id: 'org.gnome.settings-daemon.peripherals.touchscreen' });
this._loginScreenSettings = new Gio.Settings({schema_id: LOGIN_SCREEN_SCHEMA});
this._lockdownSettings = new Gio.Settings({schema_id: LOCKDOWN_SCHEMA});
this._orientationSettings = new Gio.Settings({schema_id: 'org.gnome.settings-daemon.peripherals.touchscreen'});
this._session = new GnomeSession.SessionManager();
this._loginManager = LoginManager.getLoginManager();

View File

@ -58,7 +58,7 @@ class AccessDialog extends ModalDialog.ModalDialog {
let check = new CheckBox.CheckBox();
check.getLabelActor().text = name;
check.checked = selected == "true";
check.checked = selected === 'true';
content.add_child(check);
this._choices.set(id, check);

View File

@ -2153,7 +2153,7 @@ class FolderView extends BaseAppView {
if (appIndex === -1)
return [-1, -1];
const { itemsPerPage } = this._grid;
const {itemsPerPage} = this._grid;
return [Math.floor(appIndex / itemsPerPage), appIndex % itemsPerPage];
}

View File

@ -335,9 +335,9 @@ var LayoutManager = GObject.registerClass({
let display = global.display;
display.connect('restacked',
this._windowsRestacked.bind(this));
this._windowsRestacked.bind(this));
display.connect('in-fullscreen-changed',
this._updateFullscreen.bind(this));
this._updateFullscreen.bind(this));
const monitorManager = global.backend.get_monitor_manager();
monitorManager.connectObject(

View File

@ -71,7 +71,7 @@ class MediaMessage extends MessageList.Message {
if (this._player.trackCoverUrl) {
let file = Gio.File.new_for_uri(this._player.trackCoverUrl);
this._icon.gicon = new Gio.FileIcon({ file });
this._icon.gicon = new Gio.FileIcon({file});
this._icon.remove_style_class_name('fallback');
} else if (this._player.app) {
this._icon.gicon = this._player.app.icon;

View File

@ -506,7 +506,7 @@ class ControlsManager extends St.Widget {
() => this._shiftState(Meta.MotionDirection.UP));
Main.wm.addKeybinding('shift-overview-down',
new Gio.Settings({ schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA }),
new Gio.Settings({schema_id: WindowManager.SHELL_KEYBINDINGS_SCHEMA}),
Meta.KeyBindingFlags.IGNORE_AUTOREPEAT,
Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW,
() => this._shiftState(Meta.MotionDirection.DOWN));

View File

@ -104,7 +104,7 @@ var KeybindingEntry = GObject.registerClass({
Signals: { 'keybinding-edited': { param_types: [GObject.TYPE_STRING] } },
}, class KeybindingEntry extends St.Entry {
_init() {
super._init({ hint_text: _("New shortcut…"), style: 'width: 10em' });
super._init({hint_text: _('New shortcut…'), style: 'width: 10em'});
}
vfunc_captured_event(event) {

View File

@ -239,7 +239,7 @@ var PopupBaseMenuItem = GObject.registerClass({
}
setOrnament(ornament) {
if (ornament == this._ornament)
if (ornament === this._ornament)
return;
this._ornament = ornament;

View File

@ -94,10 +94,10 @@ var ScreenShield = class extends Signals.EventEmitter {
this._smartcardManager = SmartcardManager.getSmartcardManager();
this._smartcardManager.connect('smartcard-inserted',
(manager, token) => {
if (this._isLocked && token.UsedToLogin)
this._activateDialog();
});
(manager, token) => {
if (this._isLocked && token.UsedToLogin)
this._activateDialog();
});
this._credentialManagers = {};
this.addCredentialManager(OVirt.SERVICE_NAME, OVirt.getOVirtCredentialsManager());

View File

@ -1272,7 +1272,7 @@ var ScreenshotUI = GObject.registerClass({
this._shotButton.bind_property('checked', this._castButton, 'checked',
GObject.BindingFlags.BIDIRECTIONAL | GObject.BindingFlags.INVERT_BOOLEAN);
this._captureButton = new St.Button({ style_class: 'screenshot-ui-capture-button' });
this._captureButton = new St.Button({style_class: 'screenshot-ui-capture-button'});
this._captureButton.set_child(new St.Widget({
style_class: 'screenshot-ui-capture-button-circle',
}));

View File

@ -540,7 +540,7 @@ class GridSearchResults extends SearchResultsBase {
});
var SearchResultsView = GObject.registerClass({
Signals: { 'terms-changed': {} },
Signals: {'terms-changed': {}},
}, class SearchResultsView extends St.BoxLayout {
_init() {
super._init({

View File

@ -324,9 +324,10 @@ var SearchController = GObject.registerClass({
/**
* addProvider:
* @param {object} provider - a search provider implementation
*
* Add a search provider to the controller.
*
* @param {object} provider - a search provider implementation
*/
addProvider(provider) {
this._searchResults._registerProvider(provider);
@ -334,9 +335,10 @@ var SearchController = GObject.registerClass({
/**
* removeProvider:
* @param {object} provider - a search provider implementation
*
* Remove a search provider from the controller.
*
* @param {object} provider - a search provider implementation
*/
removeProvider(provider) {
this._searchResults._unregisterProvider(provider);

View File

@ -289,17 +289,17 @@ var ShellMountPasswordDialog = GObject.registerClass({
let curGridRow = 0;
if (flags & Gio.AskPasswordFlags.TCRYPT) {
this._hiddenVolume = new CheckBox.CheckBox(_("Hidden Volume"));
this._hiddenVolume = new CheckBox.CheckBox(_('Hidden Volume'));
content.add_child(this._hiddenVolume);
this._systemVolume = new CheckBox.CheckBox(_("Windows System Volume"));
this._systemVolume = new CheckBox.CheckBox(_('Windows System Volume'));
content.add_child(this._systemVolume);
this._keyfilesCheckbox = new CheckBox.CheckBox(_("Uses Keyfiles"));
this._keyfilesCheckbox.connect("clicked", this._onKeyfilesCheckboxClicked.bind(this));
this._keyfilesCheckbox = new CheckBox.CheckBox(_('Uses Keyfiles'));
this._keyfilesCheckbox.connect('clicked', this._onKeyfilesCheckboxClicked.bind(this));
content.add_child(this._keyfilesCheckbox);
this._keyfilesLabel = new St.Label({ visible: false });
this._keyfilesLabel = new St.Label({visible: false});
if (disksApp) {
this._keyfilesLabel.clutter_text.set_markup(
/* Translators: %s is the Disks application */
@ -374,7 +374,7 @@ var ShellMountPasswordDialog = GObject.registerClass({
content.add_child(passwordGrid);
if (flags & Gio.AskPasswordFlags.SAVING_SUPPORTED) {
this._rememberChoice = new CheckBox.CheckBox(_("Remember Password"));
this._rememberChoice = new CheckBox.CheckBox(_('Remember Password'));
this._rememberChoice.checked =
global.settings.get_boolean(REMEMBER_MOUNT_PASSWORD_KEY);
content.add_child(this._rememberChoice);
@ -385,17 +385,17 @@ var ShellMountPasswordDialog = GObject.registerClass({
this.contentLayout.add_child(content);
this._defaultButtons = [{
label: _("Cancel"),
label: _('Cancel'),
action: this._onCancelButton.bind(this),
key: Clutter.KEY_Escape,
}, {
label: _("Unlock"),
label: _('Unlock'),
action: this._onUnlockButton.bind(this),
default: true,
}];
this._usesKeyfilesButtons = [{
label: _("Cancel"),
label: _('Cancel'),
action: this._onCancelButton.bind(this),
key: Clutter.KEY_Escape,
}];

View File

@ -74,7 +74,7 @@ class ATIndicator extends PanelMenu.Button {
let bounceKeys = this._buildItem(_("Bounce Keys"), A11Y_KEYBOARD_SCHEMA, KEY_BOUNCE_KEYS_ENABLED);
this.menu.addMenuItem(bounceKeys);
let mouseKeys = this._buildItem(_("Mouse Keys"), A11Y_KEYBOARD_SCHEMA, KEY_MOUSE_KEYS_ENABLED);
let mouseKeys = this._buildItem(_('Mouse Keys'), A11Y_KEYBOARD_SCHEMA, KEY_MOUSE_KEYS_ENABLED);
this.menu.addMenuItem(mouseKeys);
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());

View File

@ -413,7 +413,7 @@ var InputSourceManager = class extends Signals.EventEmitter {
// effect without considerable work to consolidate the usage
// of pushModal/popModal and grabHelper. See
// https://bugzilla.gnome.org/show_bug.cgi?id=695143 .
if (Main.actionMode == Shell.ActionMode.POPUP) {
if (Main.actionMode === Shell.ActionMode.POPUP) {
this._modifiersSwitcher();
return;
}

View File

@ -329,7 +329,7 @@ var WorkspaceTracker = class {
_windowEnteredMonitor(metaDisplay, monitorIndex, _metaWin) {
// If the window entered the primary monitor, that
// might make that workspace non-empty
if (monitorIndex == Main.layoutManager.primaryIndex)
if (monitorIndex === Main.layoutManager.primaryIndex)
this._queueCheckWorkspaces();
}

View File

@ -58,7 +58,7 @@ var WindowMenu = class extends PopupMenu.PopupMenu {
if (!window.can_maximize())
item.setSensitive(false);
item = this.addAction(_("Move"), event => {
item = this.addAction(_('Move'), event => {
const device = event.get_device();
const seat = device.get_seat();
const deviceType = device.get_device_type();
@ -77,7 +77,7 @@ var WindowMenu = class extends PopupMenu.PopupMenu {
if (!window.allows_move())
item.setSensitive(false);
item = this.addAction(_("Resize"), event => {
item = this.addAction(_('Resize'), event => {
const device = event.get_device();
const seat = device.get_seat();
const deviceType = device.get_device_type();