[polari/wip/fmuellner/more-style-changes: 5/7] style: Use a consistent style for array literals
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/more-style-changes: 5/7] style: Use a consistent style for array literals
- Date: Wed, 27 Feb 2019 16:14:40 +0000 (UTC)
commit 75d9ae1cc5d2837049444b1d26aa592cf1c7d6fb
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Jul 28 01:08:39 2018 +0200
style: Use a consistent style for array literals
Most array literals already use a four-space indent, except the ones in
GObject metainfo and function parameters. Reindent those as well to make
the style consistent and bring it closer to gjs' coding style.
https://gitlab.gnome.org/GNOME/polari/merge_requests/93
lint/eslintrc-legacy.json | 1 -
src/application.js | 7 ++++---
src/connections.js | 20 ++++++++++++--------
src/entryArea.js | 24 ++++++++++++++----------
src/initialSetup.js | 12 +++++++-----
src/ircParser.js | 31 +++++++++++++++++--------------
src/joinDialog.js | 35 +++++++++++++++++++----------------
src/mainWindow.js | 18 ++++++++++--------
src/roomList.js | 32 ++++++++++++++++++++------------
src/serverRoomManager.js | 12 +++++++-----
src/userList.js | 37 +++++++++++++++++++++----------------
src/userTracker.js | 9 +++++----
12 files changed, 136 insertions(+), 102 deletions(-)
---
diff --git a/lint/eslintrc-legacy.json b/lint/eslintrc-legacy.json
index e4b2fb0..8b71651 100644
--- a/lint/eslintrc-legacy.json
+++ b/lint/eslintrc-legacy.json
@@ -9,7 +9,6 @@
"CallExpression[callee.object.name=GObject][callee.property.name=registerClass] >
ClassExpression:first-child"
],
"CallExpression": { "arguments": "first" },
- "ArrayExpression": "first",
"ObjectExpression": "first",
"MemberExpression": "off"
}
diff --git a/src/application.js b/src/application.js
index b1cdb39..8e2c97c 100644
--- a/src/application.js
+++ b/src/application.js
@@ -417,9 +417,10 @@ var Application = GObject.registerClass({
else
this._createAccount(matchedId, server, port, a => {
if (a)
- joinAction.activate(new GLib.Variant('(ssu)',
- [a.get_object_path(),
- `#${room}`, time]));
+ joinAction.activate(new GLib.Variant('(ssu)', [
+ a.get_object_path(),
+ `#${room}`, time
+ ]));
});
});
}
diff --git a/src/connections.js b/src/connections.js
index d5379a3..4dc4b14 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -249,11 +249,13 @@ var ConnectionsList = GObject.registerClass({
var ConnectionDetails = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/connection-details.ui',
- InternalChildren: ['nameEntry',
- 'serverEntry',
- 'nickEntry',
- 'realnameEntry',
- 'sslCheckbox'],
+ InternalChildren: [
+ 'nameEntry',
+ 'serverEntry',
+ 'nickEntry',
+ 'realnameEntry',
+ 'sslCheckbox'
+ ],
Properties: { 'can-confirm': GObject.ParamSpec.boolean('can-confirm',
'can-confirm',
'can-confirm',
@@ -482,9 +484,11 @@ var ConnectionDetails = GObject.registerClass({
var ConnectionProperties = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/connection-properties.ui',
- InternalChildren: ['details',
- 'errorBox',
- 'errorLabel'],
+ InternalChildren: [
+ 'details',
+ 'errorBox',
+ 'errorLabel'
+ ]
}, class ConnectionProperties extends Gtk.Dialog {
_init(account) {
/* Translators: %s is a connection name */
diff --git a/src/entryArea.js b/src/entryArea.js
index f22fbb5..c8fab86 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -105,8 +105,10 @@ var ChatEntry = GObject.registerClass({
var NickPopover = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/nick-popover.ui',
- InternalChildren: ['nickEntry',
- 'changeButton'],
+ InternalChildren: [
+ 'nickEntry',
+ 'changeButton'
+ ],
Properties: {
nick: GObject.ParamSpec.string('nick',
'nick',
@@ -150,14 +152,16 @@ var NickPopover = GObject.registerClass({
var EntryArea = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/entry-area.ui',
- InternalChildren: ['chatEntry',
- 'nickButton',
- 'nickLabel',
- 'pasteBox',
- 'confirmLabel',
- 'uploadLabel',
- 'cancelButton',
- 'pasteButton'],
+ InternalChildren: [
+ 'chatEntry',
+ 'nickButton',
+ 'nickLabel',
+ 'pasteBox',
+ 'confirmLabel',
+ 'uploadLabel',
+ 'cancelButton',
+ 'pasteButton'
+ ],
Properties: {
'max-nick-chars': GObject.ParamSpec.uint('max-nick-chars',
'max-nick-chars',
diff --git a/src/initialSetup.js b/src/initialSetup.js
index fd856d3..bdc4405 100644
--- a/src/initialSetup.js
+++ b/src/initialSetup.js
@@ -12,11 +12,13 @@ const SetupPage = {
var InitialSetupWindow = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/initial-setup-window.ui',
- InternalChildren: ['contentStack',
- 'connectionsList',
- 'nextButton',
- 'prevButton',
- 'serverRoomList'],
+ InternalChildren: [
+ 'contentStack',
+ 'connectionsList',
+ 'nextButton',
+ 'prevButton',
+ 'serverRoomList'
+ ]
}, class InitialSetupWindow extends Gtk.Window {
_init(params) {
diff --git a/src/ircParser.js b/src/ircParser.js
index 4bf5b48..acaeeae 100644
--- a/src/ircParser.js
+++ b/src/ircParser.js
@@ -124,10 +124,11 @@ var IrcParser = class {
let account = this._room.account;
let app = Gio.Application.get_default();
let action = app.lookup_action('join-room');
- action.activate(GLib.Variant.new('(ssu)',
- [account.get_object_path(),
- room,
- Utils.getTpEventTime()]));
+ action.activate(GLib.Variant.new('(ssu)', [
+ account.get_object_path(),
+ room,
+ Utils.getTpEventTime()
+ ]));
break;
}
case 'KICK': {
@@ -175,11 +176,12 @@ var IrcParser = class {
let app = Gio.Application.get_default();
let action = app.lookup_action('message-user');
- action.activate(GLib.Variant.new('(sssu)',
- [account.get_object_path(),
- nick,
- message,
- Tp.USER_ACTION_TIME_NOT_USER_ACTION]));
+ action.activate(GLib.Variant.new('(sssu)', [
+ account.get_object_path(),
+ nick,
+ message,
+ Tp.USER_ACTION_TIME_NOT_USER_ACTION
+ ]));
break;
}
case 'NAMES': {
@@ -231,11 +233,12 @@ var IrcParser = class {
let app = Gio.Application.get_default();
let action = app.lookup_action('message-user');
- action.activate(GLib.Variant.new('(sssu)',
- [account.get_object_path(),
- nick,
- '',
- Utils.getTpEventTime()]));
+ action.activate(GLib.Variant.new('(sssu)', [
+ account.get_object_path(),
+ nick,
+ '',
+ Utils.getTpEventTime()
+ ]));
break;
}
case 'QUIT': {
diff --git a/src/joinDialog.js b/src/joinDialog.js
index bd122de..1861775 100644
--- a/src/joinDialog.js
+++ b/src/joinDialog.js
@@ -12,18 +12,20 @@ const DialogPage = {
var JoinDialog = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/join-room-dialog.ui',
- InternalChildren: ['cancelButton',
- 'joinButton',
- 'mainStack',
- 'connectionCombo',
- 'connectionButton',
- 'connectionStack',
- 'filterEntry',
- 'connectionsList',
- 'serverRoomList',
- 'details',
- 'addButton',
- 'customToggle'],
+ InternalChildren: [
+ 'cancelButton',
+ 'joinButton',
+ 'mainStack',
+ 'connectionCombo',
+ 'connectionButton',
+ 'connectionStack',
+ 'filterEntry',
+ 'connectionsList',
+ 'serverRoomList',
+ 'details',
+ 'addButton',
+ 'customToggle'
+ ]
}, class JoinDialog extends Gtk.Dialog {
_init(params) {
params['use-header-bar'] = 1;
@@ -169,10 +171,11 @@ var JoinDialog = GObject.registerClass({
let app = Gio.Application.get_default();
let action = app.lookup_action('join-room');
- action.activate(GLib.Variant.new('(ssu)',
- [account.get_object_path(),
- room,
- Utils.getTpEventTime()]));
+ action.activate(GLib.Variant.new('(ssu)', [
+ account.get_object_path(),
+ room,
+ Utils.getTpEventTime()
+ ]));
});
}
diff --git a/src/mainWindow.js b/src/mainWindow.js
index 4a62749..b319ba6 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -79,14 +79,16 @@ var FixedSizeFrame = GObject.registerClass({
var MainWindow = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/main-window.ui',
- InternalChildren: ['titlebarRight',
- 'titlebarLeft',
- 'joinButton',
- 'showUserListButton',
- 'userListPopover',
- 'roomListRevealer',
- 'overlay',
- 'roomStack'],
+ InternalChildren: [
+ 'titlebarRight',
+ 'titlebarLeft',
+ 'joinButton',
+ 'showUserListButton',
+ 'userListPopover',
+ 'roomListRevealer',
+ 'overlay',
+ 'roomStack',
+ ],
Properties: {
subtitle: GObject.ParamSpec.string('subtitle',
'subtitle',
diff --git a/src/roomList.js b/src/roomList.js
index 5e3635f..740d83b 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -17,7 +17,13 @@ function _onPopoverVisibleChanged(popover) {
var RoomRow = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/room-list-row.ui',
- InternalChildren: ['eventBox', 'icon', 'roomLabel', 'counter', 'eventStack'],
+ InternalChildren: [
+ 'eventBox',
+ 'icon',
+ 'roomLabel',
+ 'counter',
+ 'eventStack'
+ ]
}, class RoomRow extends Gtk.ListBoxRow {
_init(room) {
super._init({ name: `RoomRow ${room.display_name}` });
@@ -198,17 +204,19 @@ var RoomRow = GObject.registerClass({
var RoomListHeader = GObject.registerClass({
CssName: 'row',
Template: 'resource:///org/gnome/Polari/ui/room-list-header.ui',
- InternalChildren: ['label',
- 'iconStack',
- 'popoverStatus',
- 'popoverTitle',
- 'popoverPassword',
- 'popoverConnect',
- 'popoverDisconnect',
- 'popoverReconnect',
- 'popoverRemove',
- 'popoverProperties',
- 'spinner'],
+ InternalChildren: [
+ 'label',
+ 'iconStack',
+ 'popoverStatus',
+ 'popoverTitle',
+ 'popoverPassword',
+ 'popoverConnect',
+ 'popoverDisconnect',
+ 'popoverReconnect',
+ 'popoverRemove',
+ 'popoverProperties',
+ 'spinner'
+ ]
}, class RoomListHeader extends Gtk.MenuButton {
_init(params) {
this._account = params.account;
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index 592d345..17b2e36 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -108,11 +108,13 @@ function _strBaseEqual(str1, str2) {
var ServerRoomList = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/server-room-list.ui',
- InternalChildren: ['filterEntry',
- 'list',
- 'spinner',
- 'store',
- 'toggleRenderer'],
+ InternalChildren: [
+ 'filterEntry',
+ 'list',
+ 'spinner',
+ 'store',
+ 'toggleRenderer'
+ ],
Properties: { 'can-join': GObject.ParamSpec.boolean('can-join',
'can-join',
'can-join',
diff --git a/src/userList.js b/src/userList.js
index 293f40d..6b5903f 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -94,13 +94,15 @@ class UserListPopover extends Gtk.Popover {
var UserDetails = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/user-details.ui',
- InternalChildren: ['spinnerBox',
- 'spinner',
- 'detailsGrid',
- 'fullnameLabel',
- 'lastLabel',
- 'notificationLabel',
- 'messageButton'],
+ InternalChildren: [
+ 'spinnerBox',
+ 'spinner',
+ 'detailsGrid',
+ 'fullnameLabel',
+ 'lastLabel',
+ 'notificationLabel',
+ 'messageButton'
+ ],
Properties: { 'expanded': GObject.ParamSpec.boolean('expanded',
'expanded',
'expanded',
@@ -293,11 +295,12 @@ var UserDetails = GObject.registerClass({
let app = Gio.Application.get_default();
let action = app.lookup_action('message-user');
let time = Gtk.get_current_event().get_time();
- action.activate(GLib.Variant.new('(sssu)',
- [account.get_object_path(),
- this._user.alias,
- '',
- time]));
+ action.activate(GLib.Variant.new('(sssu)', [
+ account.get_object_path(),
+ this._user.alias,
+ '',
+ time
+ ]));
}
_updateButtonVisibility() {
@@ -319,10 +322,12 @@ var UserDetails = GObject.registerClass({
var UserPopover = GObject.registerClass({
Template: 'resource:///org/gnome/Polari/ui/user-popover.ui',
- InternalChildren: ['nickLabel',
- 'statusLabel',
- 'notifyButton',
- 'userDetails'],
+ InternalChildren: [
+ 'nickLabel',
+ 'statusLabel',
+ 'notifyButton',
+ 'userDetails'
+ ]
}, class UserPopover extends Gtk.Popover {
_init(params) {
this._room = params.room;
diff --git a/src/userTracker.js b/src/userTracker.js
index c9328d7..1381fe2 100644
--- a/src/userTracker.js
+++ b/src/userTracker.js
@@ -307,10 +307,11 @@ const UserTracker = GObject.registerClass({
notification.set_title(_("User is online"));
notification.set_body(_("User %s is now online.").format(member.alias));
- let param = GLib.Variant.new('(ssu)',
- [this._account.get_object_path(),
- room.channel_name,
- Utils.getTpEventTime()]);
+ let param = GLib.Variant.new('(ssu)', [
+ this._account.get_object_path(),
+ room.channel_name,
+ Utils.getTpEventTime()
+ ]);
notification.set_default_action_and_target('app.join-room', param);
this._app.send_notification(this._getNotifyActionNameInternal(member.alias), notification);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]