cleanup: Avoid unnecessary braces

Our coding style has always been to avoid braces when all blocks
are single-lines.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:
Florian Müllner
2019-08-20 02:51:42 +02:00
committed by Georges Basile Stavracas Neto
parent 69f63dc94f
commit 67ea424525
38 changed files with 136 additions and 201 deletions

View File

@ -78,11 +78,10 @@ var AuthPrompt = GObject.registerClass({
this.connect('next', () => {
this.updateSensitivity(false);
this.startSpinning();
if (this._queryingService) {
if (this._queryingService)
this._userVerifier.answerQuery(this._queryingService, this._entry.text);
} else {
else
this._preemptiveAnswer = this._entry.text;
}
});
this.connect('destroy', this._onDestroy.bind(this));
@ -525,9 +524,9 @@ var AuthPrompt = GObject.registerClass({
}
cancel() {
if (this.verificationStatus == AuthPromptStatus.VERIFICATION_SUCCEEDED) {
if (this.verificationStatus == AuthPromptStatus.VERIFICATION_SUCCEEDED)
return;
}
this.reset();
this.emit('cancelled');
}

View File

@ -112,13 +112,12 @@ var Batch = class extends Task {
for (let i = 0; i < tasks.length; i++) {
let task;
if (tasks[i] instanceof Task) {
if (tasks[i] instanceof Task)
task = tasks[i];
} else if (typeof tasks[i] == 'function') {
else if (typeof tasks[i] == 'function')
task = new Task(scope, tasks[i]);
} else {
else
throw new Error('Batch tasks must be functions or Task, Hold or Batch objects');
}
this.tasks.push(task);
}
@ -129,9 +128,8 @@ var Batch = class extends Task {
}
runTask() {
if (!(this._currentTaskIndex in this.tasks)) {
if (!(this._currentTaskIndex in this.tasks))
return null;
}
return this.tasks[this._currentTaskIndex].run();
}
@ -179,9 +177,8 @@ var ConcurrentBatch = class extends Batch {
process() {
let hold = this.runTask();
if (hold) {
if (hold)
this.hold.acquireUntilAfter(hold);
}
// Regardless of the state of the just run task,
// fire off the next one, so all the tasks can run

View File

@ -702,9 +702,8 @@ var LoginDialog = GObject.registerClass({
}
// Finally hand out the allocations
if (bannerAllocation) {
if (bannerAllocation)
this._bannerView.allocate(bannerAllocation, flags);
}
if (authPromptAllocation)
this._authPrompt.allocate(authPromptAllocation, flags);
@ -820,9 +819,9 @@ var LoginDialog = GObject.registerClass({
_resetGreeterProxy() {
if (GLib.getenv('GDM_GREETER_TEST') != '1') {
if (this._greeter) {
if (this._greeter)
this._greeter.run_dispose();
}
this._greeter = this._gdmClient.get_greeter_sync(null);
this._defaultSessionChangedId = this._greeter.connect('default-session-name-changed',
@ -1039,9 +1038,8 @@ var LoginDialog = GObject.registerClass({
() => {
// If we're just starting out, start on the right item.
if (!this._userManager.is_loaded) {
if (!this._userManager.is_loaded)
this._userList.jumpToItem(loginItem);
}
},
() => {
@ -1092,9 +1090,8 @@ var LoginDialog = GObject.registerClass({
// Restart timed login on user interaction
global.stage.connect('captured-event', (actor, event) => {
if (event.type() == Clutter.EventType.KEY_PRESS ||
event.type() == Clutter.EventType.BUTTON_PRESS) {
event.type() == Clutter.EventType.BUTTON_PRESS)
this._startTimedLogin(userName, seconds);
}
return Clutter.EVENT_PROPAGATE;
});
@ -1201,9 +1198,8 @@ var LoginDialog = GObject.registerClass({
let users = this._userManager.list_users();
for (let i = 0; i < users.length; i++) {
for (let i = 0; i < users.length; i++)
this._userList.addUser(users[i]);
}
this._updateDisableUserList();

View File

@ -571,9 +571,8 @@ var ShellUserVerifier = class {
// if the password service fails, then cancel everything.
// But if, e.g., fingerprint fails, still give
// password authentication a chance to succeed
if (this.serviceIsForeground(serviceName)) {
if (this.serviceIsForeground(serviceName))
this._verificationFailed(true);
}
}
};
Signals.addSignalMethods(ShellUserVerifier.prototype);