cleanup: Only omit braces for single-line blocks
Braces can be avoided when a block consists of a single statement, but readability suffers when the statement spans more than a single line. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
c860409da5
commit
07cc84f632
@ -222,11 +222,12 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
||||
validate: this._validateStaticWep, password: true });
|
||||
break;
|
||||
case 'ieee8021x':
|
||||
if (wirelessSecuritySetting.auth_alg == 'leap') // Cisco LEAP
|
||||
if (wirelessSecuritySetting.auth_alg == 'leap') { // Cisco LEAP
|
||||
secrets.push({ label: _("Password: "), key: 'leap-password',
|
||||
value: wirelessSecuritySetting.leap_password || '', password: true });
|
||||
else // Dynamic (IEEE 802.1x) WEP
|
||||
} else { // Dynamic (IEEE 802.1x) WEP
|
||||
this._get8021xSecrets(secrets);
|
||||
}
|
||||
break;
|
||||
case 'wpa-eap':
|
||||
this._get8021xSecrets(secrets);
|
||||
@ -241,15 +242,18 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
||||
|
||||
/* If hints were given we know exactly what we need to ask */
|
||||
if (this._settingName == "802-1x" && this._hints.length) {
|
||||
if (this._hints.includes('identity'))
|
||||
if (this._hints.includes('identity')) {
|
||||
secrets.push({ label: _("Username: "), key: 'identity',
|
||||
value: ieee8021xSetting.identity || '', password: false });
|
||||
if (this._hints.includes('password'))
|
||||
}
|
||||
if (this._hints.includes('password')) {
|
||||
secrets.push({ label: _("Password: "), key: 'password',
|
||||
value: ieee8021xSetting.password || '', password: true });
|
||||
if (this._hints.includes('private-key-password'))
|
||||
}
|
||||
if (this._hints.includes('private-key-password')) {
|
||||
secrets.push({ label: _("Private key password: "), key: 'private-key-password',
|
||||
value: ieee8021xSetting.private_key_password || '', password: true });
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -231,11 +231,12 @@ class TelepathyClient extends Tp.BaseClient {
|
||||
return;
|
||||
}
|
||||
|
||||
if (chanType == Tp.IFACE_CHANNEL_TYPE_TEXT)
|
||||
if (chanType == Tp.IFACE_CHANNEL_TYPE_TEXT) {
|
||||
this._approveTextChannel(account, conn, channel, dispatchOp, context);
|
||||
else
|
||||
} else {
|
||||
context.fail(new Tp.Error({ code: Tp.Error.INVALID_ARGUMENT,
|
||||
message: 'Unsupported channel type' }));
|
||||
}
|
||||
}
|
||||
|
||||
_approveTextChannel(account, conn, channel, dispatchOp, context) {
|
||||
@ -386,10 +387,11 @@ class ChatSource extends MessageTray.Source {
|
||||
|
||||
_updateAvatarIcon() {
|
||||
this.iconUpdated();
|
||||
if (this._notifiction)
|
||||
if (this._notifiction) {
|
||||
this._notification.update(this._notification.title,
|
||||
this._notification.bannerBodyText,
|
||||
{ gicon: this.getIcon() });
|
||||
}
|
||||
}
|
||||
|
||||
open() {
|
||||
@ -601,10 +603,11 @@ class ChatSource extends MessageTray.Source {
|
||||
}
|
||||
|
||||
_presenceChanged(_contact, _presence, _status, _message) {
|
||||
if (this._notification)
|
||||
if (this._notification) {
|
||||
this._notification.update(this._notification.title,
|
||||
this._notification.bannerBodyText,
|
||||
{ secondaryGIcon: this.getSecondaryIcon() });
|
||||
}
|
||||
}
|
||||
|
||||
_pendingRemoved(channel, message) {
|
||||
@ -674,10 +677,11 @@ var ChatNotification = HAVE_TP ? GObject.registerClass({
|
||||
styles.push('chat-action');
|
||||
}
|
||||
|
||||
if (message.direction == NotificationDirection.RECEIVED)
|
||||
if (message.direction == NotificationDirection.RECEIVED) {
|
||||
this.update(this.source.title, messageBody,
|
||||
{ datetime: GLib.DateTime.new_from_unix_local(message.timestamp),
|
||||
bannerMarkup: true });
|
||||
}
|
||||
|
||||
let group = (message.direction == NotificationDirection.RECEIVED
|
||||
? 'received' : 'sent');
|
||||
|
Reference in New Issue
Block a user