[polari] style: Use new indentation style for GObject property definitions
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] style: Use new indentation style for GObject property definitions
- Date: Sun, 21 Apr 2019 22:10:57 +0000 (UTC)
commit a04fa451b1a22919c646a0840cb5cb6c4fe7201d
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Jul 28 01:08:39 2018 +0200
style: Use new indentation style for GObject property definitions
For regular methods, we can just transition gradually to the new style,
but it would be odd to add new properties with a different style than
existing ones, so switch them in bulk.
https://bugzilla.gnome.org/show_bug.cgi?id=768851
src/accountsMonitor.js | 9 ++++-----
src/chatView.js | 37 ++++++++++++++++---------------------
src/connections.js | 28 ++++++++++++----------------
src/entryArea.js | 18 ++++++++----------
src/mainWindow.js | 45 ++++++++++++++++++++-------------------------
src/pasteManager.js | 7 ++++---
src/roomStack.js | 9 ++++-----
src/serverRoomManager.js | 9 ++++-----
src/userList.js | 20 ++++++++------------
9 files changed, 80 insertions(+), 102 deletions(-)
---
diff --git a/src/accountsMonitor.js b/src/accountsMonitor.js
index 57b5847..ca3613f 100644
--- a/src/accountsMonitor.js
+++ b/src/accountsMonitor.js
@@ -176,11 +176,10 @@ class ClientFactory extends Polari.ClientFactory {
const PolariAccount = GObject.registerClass({
Properties: {
- visible: GObject.ParamSpec.boolean('visible',
- 'visible',
- 'visible',
- GObject.ParamFlags.READWRITE,
- true)
+ visible: GObject.ParamSpec.boolean(
+ 'visible', 'visible', 'visible',
+ GObject.ParamFlags.READWRITE,
+ true)
}
}, class PolariAccount extends Tp.Account {
_init(params) {
diff --git a/src/chatView.js b/src/chatView.js
index e2d661d..076c5a0 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -140,11 +140,10 @@ class TextView extends Gtk.TextView {
const ButtonTag = GObject.registerClass({
Properties: {
- 'hover': GObject.ParamSpec.boolean('hover',
- 'hover',
- 'hover',
- GObject.ParamFlags.READWRITE,
- false)
+ 'hover': GObject.ParamSpec.boolean(
+ 'hover', 'hover', 'hover',
+ GObject.ParamFlags.READWRITE,
+ false)
},
Signals: {
'clicked': {},
@@ -212,17 +211,14 @@ const ButtonTag = GObject.registerClass({
const HoverFilterTag = GObject.registerClass({
Properties: {
- 'filtered-tag': GObject.ParamSpec.object('filtered-tag',
- 'filtered-tag',
- 'filtered-tag',
- GObject.ParamFlags.READWRITE |
- GObject.ParamFlags.CONSTRUCT_ONLY,
- Gtk.TextTag.$gtype),
- 'hover-opacity': GObject.ParamSpec.double('hover-opacity',
- 'hover-opacity',
- 'hover-opacity',
- GObject.ParamFlags.READWRITE,
- 0.0, 1.0, 1.0)
+ 'filtered-tag': GObject.ParamSpec.object(
+ 'filtered-tag', 'filtered-tag', 'filtered-tag',
+ GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
+ Gtk.TextTag.$gtype),
+ 'hover-opacity': GObject.ParamSpec.double(
+ 'hover-opacity', 'hover-opacity', 'hover-opacity',
+ GObject.ParamFlags.READWRITE,
+ 0.0, 1.0, 1.0)
}
}, class HoverFilterTag extends ButtonTag {
_init(params) {
@@ -281,11 +277,10 @@ var ChatView = GObject.registerClass({
Implements: [DropTargetIface],
Properties: {
'can-drop': GObject.ParamSpec.override('can-drop', DropTargetIface),
- 'max-nick-chars': GObject.ParamSpec.uint('max-nick-chars',
- 'max-nick-chars',
- 'max-nick-chars',
- GObject.ParamFlags.READABLE,
- 0, GLib.MAXUINT32, 0)
+ 'max-nick-chars': GObject.ParamSpec.uint(
+ 'max-nick-chars', 'max-nick-chars', 'max-nick-chars',
+ GObject.ParamFlags.READABLE,
+ 0, GLib.MAXUINT32, 0)
}
}, class ChatView extends Gtk.ScrolledWindow {
_init(room) {
diff --git a/src/connections.js b/src/connections.js
index 2d15bc7..a0bfb73 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -72,12 +72,10 @@ class ConnectionRow extends Gtk.ListBoxRow {
var ConnectionsList = GObject.registerClass({
Properties: {
- 'favorites-only': GObject.ParamSpec.boolean('favorites-only',
- 'favorites-only',
- 'favorites-only',
- GObject.ParamFlags.READWRITE |
- GObject.ParamFlags.CONSTRUCT_ONLY,
- false)
+ 'favorites-only': GObject.ParamSpec.boolean(
+ 'favorites-only', 'favorites-only', 'favorites-only',
+ GObject.ParamFlags.READWRITE | GObject.ParamFlags.CONSTRUCT_ONLY,
+ false)
},
Signals: {
'account-created': { param_types: [Tp.Account.$gtype] },
@@ -270,16 +268,14 @@ var ConnectionDetails = GObject.registerClass({
'sslCheckbox'
],
Properties: {
- 'can-confirm': GObject.ParamSpec.boolean('can-confirm',
- 'can-confirm',
- 'can-confirm',
- GObject.ParamFlags.READABLE,
- false),
- 'has-serivce': GObject.ParamSpec.boolean('has-service',
- 'has-service',
- 'has-service',
- GObject.ParamFlags.READABLE,
- false)
+ 'can-confirm': GObject.ParamSpec.boolean(
+ 'can-confirm', 'can-confirm', 'can-confirm',
+ GObject.ParamFlags.READABLE,
+ false),
+ 'has-serivce': GObject.ParamSpec.boolean(
+ 'has-service', 'has-service', 'has-service',
+ GObject.ParamFlags.READABLE,
+ false)
},
Signals: {
'account-created': { param_types: [Tp.Account.$gtype] }
diff --git a/src/entryArea.js b/src/entryArea.js
index 1dbbc00..363cda9 100644
--- a/src/entryArea.js
+++ b/src/entryArea.js
@@ -111,11 +111,10 @@ var NickPopover = GObject.registerClass({
'changeButton'
],
Properties: {
- nick: GObject.ParamSpec.string('nick',
- 'nick',
- 'nick',
- GObject.ParamFlags.READWRITE,
- '')
+ nick: GObject.ParamSpec.string(
+ 'nick', 'nick', 'nick',
+ GObject.ParamFlags.READWRITE,
+ '')
},
Signals: {
'nick-changed': {}
@@ -166,11 +165,10 @@ var EntryArea = GObject.registerClass({
'pasteButton'
],
Properties: {
- 'max-nick-chars': GObject.ParamSpec.uint('max-nick-chars',
- 'max-nick-chars',
- 'max-nick-chars',
- GObject.ParamFlags.WRITABLE,
- 0, GLib.MAXUINT32, 0)
+ 'max-nick-chars': GObject.ParamSpec.uint(
+ 'max-nick-chars', 'max-nick-chars', 'max-nick-chars',
+ GObject.ParamFlags.WRITABLE,
+ 0, GLib.MAXUINT32, 0)
}
}, class EntryArea extends Gtk.Stack {
static get _nickPopover() {
diff --git a/src/mainWindow.js b/src/mainWindow.js
index c52f25d..2e264ea 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -13,16 +13,14 @@ const Utils = imports.utils;
var FixedSizeFrame = GObject.registerClass({
Properties: {
- height: GObject.ParamSpec.int('height',
- 'height',
- 'height',
- GObject.ParamFlags.READWRITE,
- -1, GLib.MAXINT32, -1),
- width: GObject.ParamSpec.int('width',
- 'width',
- 'width',
- GObject.ParamFlags.READWRITE,
- -1, GLib.MAXINT32, -1)
+ height: GObject.ParamSpec.int(
+ 'height', 'height', 'height',
+ GObject.ParamFlags.READWRITE,
+ -1, GLib.MAXINT32, -1),
+ width: GObject.ParamSpec.int(
+ 'width', 'width', 'width',
+ GObject.ParamFlags.READWRITE,
+ -1, GLib.MAXINT32, -1)
}
}, class FixedSizeFrame extends Gtk.Frame {
_init(params) {
@@ -90,21 +88,18 @@ var MainWindow = GObject.registerClass({
'roomStack',
],
Properties: {
- subtitle: GObject.ParamSpec.string('subtitle',
- 'subtitle',
- 'subtitle',
- GObject.ParamFlags.READABLE,
- ''),
- 'subtitle-visible': GObject.ParamSpec.boolean('subtitle-visible',
- 'subtitle-visible',
- 'subtitle-visible',
- GObject.ParamFlags.READABLE,
- false),
- 'active-room': GObject.ParamSpec.object('active-room',
- 'active-room',
- 'active-room',
- GObject.ParamFlags.READWRITE,
- Polari.Room.$gtype)
+ subtitle: GObject.ParamSpec.string(
+ 'subtitle', 'subtitle', 'subtitle',
+ GObject.ParamFlags.READABLE,
+ ''),
+ 'subtitle-visible': GObject.ParamSpec.boolean(
+ 'subtitle-visible', 'subtitle-visible', 'subtitle-visible',
+ GObject.ParamFlags.READABLE,
+ false),
+ 'active-room': GObject.ParamSpec.object(
+ 'active-room', 'active-room', 'active-room',
+ GObject.ParamFlags.READWRITE,
+ Polari.Room.$gtype)
},
Signals: {
'active-room-state-changed': {}
diff --git a/src/pasteManager.js b/src/pasteManager.js
index 46915f2..5b326bc 100644
--- a/src/pasteManager.js
+++ b/src/pasteManager.js
@@ -74,9 +74,10 @@ var PasteManager = class {
var DropTargetIface = GObject.registerClass({
Requires: [GObject.Object],
Properties: {
- 'can-drop': GObject.ParamSpec.boolean('can-drop', '', '',
- GObject.ParamFlags.READABLE,
- false)
+ 'can-drop': GObject.ParamSpec.boolean(
+ 'can-drop', 'can-drop', 'can-drop',
+ GObject.ParamFlags.READABLE,
+ false)
},
Signals: {
'text-dropped': { param_types: [GObject.TYPE_STRING] },
diff --git a/src/roomStack.js b/src/roomStack.js
index 5d0abd0..c8a1450 100644
--- a/src/roomStack.js
+++ b/src/roomStack.js
@@ -9,11 +9,10 @@ const { RoomManager } = imports.roomManager;
var RoomStack = GObject.registerClass({
Properties: {
- 'entry-area-height': GObject.ParamSpec.uint('entry-area-height',
- 'entry-area-height',
- 'entry-area-height',
- GObject.ParamFlags.READABLE,
- 0, GLib.MAXUINT32, 0)
+ 'entry-area-height': GObject.ParamSpec.uint(
+ 'entry-area-height', 'entry-area-height', 'entry-area-height',
+ GObject.ParamFlags.READABLE,
+ 0, GLib.MAXUINT32, 0)
}
}, class RoomStack extends Gtk.Stack {
_init(params) {
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index b03b1f9..bf94c8b 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -115,11 +115,10 @@ var ServerRoomList = GObject.registerClass({
'toggleRenderer'
],
Properties: {
- 'can-join': GObject.ParamSpec.boolean('can-join',
- 'can-join',
- 'can-join',
- GObject.ParamFlags.READABLE,
- false)
+ 'can-join': GObject.ParamSpec.boolean(
+ 'can-join', 'can-join', 'can-join',
+ GObject.ParamFlags.READABLE,
+ false)
}
}, class ServerRoomList extends Gtk.Box {
_init(params) {
diff --git a/src/userList.js b/src/userList.js
index caeab24..ea9e889 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -4,8 +4,6 @@ const {
Gio, GLib, GObject, Gtk, Pango, Polari, TelepathyGLib: Tp
} = imports.gi;
-const READWRITE = GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE;
-
const MAX_USERS_SHOWN = 8;
const MAX_USERS_WIDTH_CHARS = 17;
@@ -108,16 +106,14 @@ var UserDetails = GObject.registerClass({
'messageButton'
],
Properties: {
- 'expanded': GObject.ParamSpec.boolean('expanded',
- 'expanded',
- 'expanded',
- READWRITE,
- false),
- 'notifications-enabled': GObject.ParamSpec.boolean('notifications-enabled',
- 'notifications-enabled',
- 'notifications-enabled',
- READWRITE,
- false)
+ 'expanded': GObject.ParamSpec.boolean(
+ 'expanded', 'expanded', 'expanded',
+ GObject.ParamFlags.READWRITE,
+ false),
+ 'notifications-enabled': GObject.ParamSpec.boolean(
+ 'notifications-enabled', 'notifications-enabled', 'notifications-enabled',
+ GObject.ParamFlags.READWRITE,
+ false)
}
}, class UserDetails extends Gtk.Frame {
_init(params = {}) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]