[gnome-shell] cleanup: Define GObject accessors in camelCase
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] cleanup: Define GObject accessors in camelCase
- Date: Wed, 3 Feb 2021 20:00:16 +0000 (UTC)
commit 252f2f514430567c046d1e6b3d5eda71660c91ed
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Jan 30 02:03:07 2021 +0100
cleanup: Define GObject accessors in camelCase
gjs is smart enough to match a propertyName getter/setter to the
corresponding property-name GObject property, so use that and get
rid of the eslint camelcase rule exceptions.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1611>
js/misc/modemManager.js | 6 ++----
js/misc/systemActions.js | 24 ++++++++----------------
js/ui/barLevel.js | 12 ++++--------
js/ui/dialog.js | 6 ++----
js/ui/iconGrid.js | 3 +--
js/ui/layout.js | 6 ++----
js/ui/padOsd.js | 6 ++----
js/ui/windowPreview.js | 9 +++------
js/ui/workspace.js | 6 ++----
js/ui/workspaceThumbnail.js | 12 ++++--------
10 files changed, 30 insertions(+), 60 deletions(-)
---
diff --git a/js/misc/modemManager.js b/js/misc/modemManager.js
index 5f727f3ca2..c73c93e7fd 100644
--- a/js/misc/modemManager.js
+++ b/js/misc/modemManager.js
@@ -117,13 +117,11 @@ var ModemBase = GObject.registerClass({
this._signalQuality = 0;
}
- // eslint-disable-next-line camelcase
- get operator_name() {
+ get operatorName() {
return this._operatorName;
}
- // eslint-disable-next-line camelcase
- get signal_quality() {
+ get signalQuality() {
return this._signalQuality;
}
diff --git a/js/misc/systemActions.js b/js/misc/systemActions.js
index 1cd6576488..10cab9a9e2 100644
--- a/js/misc/systemActions.js
+++ b/js/misc/systemActions.js
@@ -182,43 +182,35 @@ const SystemActions = GObject.registerClass({
this._sessionUpdated();
}
- // eslint-disable-next-line camelcase
- get can_power_off() {
+ get canPowerOff() {
return this._actions.get(POWER_OFF_ACTION_ID).available;
}
- // eslint-disable-next-line camelcase
- get can_restart() {
+ get canRestart() {
return this._actions.get(RESTART_ACTION_ID).available;
}
- // eslint-disable-next-line camelcase
- get can_suspend() {
+ get canSuspend() {
return this._actions.get(SUSPEND_ACTION_ID).available;
}
- // eslint-disable-next-line camelcase
- get can_lock_screen() {
+ get canLockScreen() {
return this._actions.get(LOCK_SCREEN_ACTION_ID).available;
}
- // eslint-disable-next-line camelcase
- get can_switch_user() {
+ get canSwitchUser() {
return this._actions.get(SWITCH_USER_ACTION_ID).available;
}
- // eslint-disable-next-line camelcase
- get can_logout() {
+ get canLogout() {
return this._actions.get(LOGOUT_ACTION_ID).available;
}
- // eslint-disable-next-line camelcase
- get can_lock_orientation() {
+ get canLockOrientation() {
return this._actions.get(LOCK_ORIENTATION_ACTION_ID).available;
}
- // eslint-disable-next-line camelcase
- get orientation_lock_icon() {
+ get orientationLockIcon() {
return this._actions.get(LOCK_ORIENTATION_ACTION_ID).iconName;
}
diff --git a/js/ui/barLevel.js b/js/ui/barLevel.js
index f4fdb6e51a..25d4835280 100644
--- a/js/ui/barLevel.js
+++ b/js/ui/barLevel.js
@@ -60,13 +60,11 @@ var BarLevel = GObject.registerClass({
this.queue_repaint();
}
- // eslint-disable-next-line camelcase
- get maximum_value() {
+ get maximumValue() {
return this._maxValue;
}
- // eslint-disable-next-line camelcase
- set maximum_value(value) {
+ set maximumValue(value) {
value = Math.max(value, 1);
if (this._maxValue == value)
@@ -78,13 +76,11 @@ var BarLevel = GObject.registerClass({
this.queue_repaint();
}
- // eslint-disable-next-line camelcase
- get overdrive_start() {
+ get overdriveStart() {
return this._overdriveStart;
}
- // eslint-disable-next-line camelcase
- set overdrive_start(value) {
+ set overdriveStart(value) {
if (this._overdriveStart == value)
return;
diff --git a/js/ui/dialog.js b/js/ui/dialog.js
index 4af154d6f7..3e8bfee7d5 100644
--- a/js/ui/dialog.js
+++ b/js/ui/dialog.js
@@ -336,13 +336,11 @@ var ListSectionItem = GObject.registerClass({
this.add_child(textLayout);
}
- // eslint-disable-next-line camelcase
- get icon_actor() {
+ get iconActor() {
return this._iconActorBin.get_child();
}
- // eslint-disable-next-line camelcase
- set icon_actor(actor) {
+ set iconActor(actor) {
this._iconActorBin.set_child(actor);
this.notify('icon-actor');
}
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index fde6c702ba..e8ac2b07ed 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -1090,8 +1090,7 @@ var IconGridLayout = GObject.registerClass({
return [null, DragLocation.EMPTY_SPACE];
}
- // eslint-disable-next-line camelcase
- get icon_size() {
+ get iconSize() {
return this._iconSize;
}
diff --git a/js/ui/layout.js b/js/ui/layout.js
index b082ec80b0..1a41a34beb 100644
--- a/js/ui/layout.js
+++ b/js/ui/layout.js
@@ -79,13 +79,11 @@ var MonitorConstraint = GObject.registerClass({
this.notify('index');
}
- // eslint-disable-next-line camelcase
- get work_area() {
+ get workArea() {
return this._workArea;
}
- // eslint-disable-next-line camelcase
- set work_area(v) {
+ set workArea(v) {
if (v == this._workArea)
return;
this._workArea = v;
diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js
index a402fad7ef..ed207415ad 100644
--- a/js/ui/padOsd.js
+++ b/js/ui/padOsd.js
@@ -322,13 +322,11 @@ var PadDiagram = GObject.registerClass({
this._initLabels();
}
- // eslint-disable-next-line camelcase
- get editor_actor() {
+ get editorActor() {
return this._editorActor;
}
- // eslint-disable-next-line camelcase
- set editor_actor(actor) {
+ set editorActor(actor) {
actor.hide();
this._editorActor = actor;
this.add_actor(actor);
diff --git a/js/ui/windowPreview.js b/js/ui/windowPreview.js
index b17c87be3b..fddb62e26e 100644
--- a/js/ui/windowPreview.js
+++ b/js/ui/windowPreview.js
@@ -188,8 +188,7 @@ var WindowPreviewLayout = GObject.registerClass({
return [...this._windows.values()].map(i => i.metaWindow);
}
- // eslint-disable-next-line camelcase
- get bounding_box() {
+ get boundingBox() {
return this._boundingBox;
}
});
@@ -631,13 +630,11 @@ var WindowPreview = GObject.registerClass({
};
}
- // eslint-disable-next-line camelcase
- get overlay_enabled() {
+ get overlayEnabled() {
return this._overlayEnabled;
}
- // eslint-disable-next-line camelcase
- set overlay_enabled(enabled) {
+ set overlayEnabled(enabled) {
if (this._overlayEnabled === enabled)
return;
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 951f452193..b3ca4cca52 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -851,13 +851,11 @@ var WorkspaceLayout = GObject.registerClass({
this.layout_changed();
}
- // eslint-disable-next-line camelcase
- get layout_frozen() {
+ get layoutFrozen() {
return this._layoutFrozen;
}
- // eslint-disable-next-line camelcase
- set layout_frozen(f) {
+ set layoutFrozen(f) {
if (this._layoutFrozen === f)
return;
diff --git a/js/ui/workspaceThumbnail.js b/js/ui/workspaceThumbnail.js
index f74c8fecbe..40a33fe3a3 100644
--- a/js/ui/workspaceThumbnail.js
+++ b/js/ui/workspaceThumbnail.js
@@ -334,8 +334,7 @@ var WorkspaceThumbnail = GObject.registerClass({
}
}
- // eslint-disable-next-line camelcase
- set slide_position(slidePosition) {
+ set slidePosition(slidePosition) {
if (this._slidePosition == slidePosition)
return;
@@ -348,13 +347,11 @@ var WorkspaceThumbnail = GObject.registerClass({
this.queue_relayout();
}
- // eslint-disable-next-line camelcase
- get slide_position() {
+ get slidePosition() {
return this._slidePosition;
}
- // eslint-disable-next-line camelcase
- set collapse_fraction(collapseFraction) {
+ set collapseFraction(collapseFraction) {
if (this._collapseFraction == collapseFraction)
return;
this._collapseFraction = collapseFraction;
@@ -362,8 +359,7 @@ var WorkspaceThumbnail = GObject.registerClass({
this.queue_relayout();
}
- // eslint-disable-next-line camelcase
- get collapse_fraction() {
+ get collapseFraction() {
return this._collapseFraction;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]