[gnome-shell-extensions] cleanup: Use consistent brace style of blocks
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] cleanup: Use consistent brace style of blocks
- Date: Wed, 21 Aug 2019 17:21:47 +0000 (UTC)
commit eceff51ba10ee15de56d191c11ec0849f3a7deec
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Aug 7 03:49:42 2019 +0200
cleanup: Use consistent brace style of blocks
Our coding style has always been to avoid braces when all blocks
are single-lines. Make sure we apply that style consistently.
https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
extensions/drive-menu/extension.js | 5 +++--
extensions/native-window-placement/extension.js | 8 ++++----
extensions/places-menu/placeDisplay.js | 9 +++++----
extensions/window-list/extension.js | 5 +++--
extensions/window-list/windowPicker.js | 3 ++-
extensions/window-list/workspaceIndicator.js | 7 +++----
extensions/windowsNavigator/extension.js | 3 ++-
extensions/workspace-indicator/extension.js | 8 ++++----
8 files changed, 26 insertions(+), 22 deletions(-)
---
diff --git a/extensions/drive-menu/extension.js b/extensions/drive-menu/extension.js
index 9bb30d2..39c720a 100644
--- a/extensions/drive-menu/extension.js
+++ b/extensions/drive-menu/extension.js
@@ -73,12 +73,13 @@ class MountMenuItem extends PopupMenu.PopupBaseMenuItem {
null // Gio.Cancellable
];
- if (this.mount.can_eject())
+ if (this.mount.can_eject()) {
this.mount.eject_with_operation(...unmountArgs,
this._ejectFinish.bind(this));
- else
+ } else {
this.mount.unmount_with_operation(...unmountArgs,
this._unmountFinish.bind(this));
+ }
}
_unmountFinish(mount, result) {
diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js
index 383322f..e58832d 100644
--- a/extensions/native-window-placement/extension.js
+++ b/extensions/native-window-placement/extension.js
@@ -98,9 +98,9 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy {
// This is used when the window is on the edge of the screen to try to use as much screen real
estate as possible.
directions[i] = direction;
direction++;
- if (direction == 4) {
+ if (direction == 4)
direction = 0;
- }
+
}
let loopCounter = 0;
@@ -212,9 +212,9 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy {
bounds.height = areaRect.height / scale;
// Move all windows back onto the screen and set their scale
- for (let i = 0; i < rects.length; i++) {
+ for (let i = 0; i < rects.length; i++)
rects[i].translate(-bounds.x, -bounds.y);
- }
+
// rescale to workspace
let slots = [];
diff --git a/extensions/places-menu/placeDisplay.js b/extensions/places-menu/placeDisplay.js
index 03189b9..69c8b9c 100644
--- a/extensions/places-menu/placeDisplay.js
+++ b/extensions/places-menu/placeDisplay.js
@@ -204,12 +204,13 @@ class PlaceDeviceInfo extends PlaceInfo {
null // Gio.Cancellable
];
- if (this._mount.can_eject())
+ if (this._mount.can_eject()) {
this._mount.eject_with_operation(...unmountArgs,
this._ejectFinish.bind(this));
- else
+ } else {
this._mount.unmount_with_operation(...unmountArgs,
this._unmountFinish.bind(this));
+ }
}
_ejectFinish(mount, result) {
@@ -462,9 +463,9 @@ var PlacesManager = class {
this._addVolume('network', networkVolumes[i]);
}
- for (let i = 0; i < networkMounts.length; i++) {
+ for (let i = 0; i < networkMounts.length; i++)
this._addMount('network', networkMounts[i]);
- }
+
this.emit('devices-updated');
this.emit('network-updated');
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 11ebaf5..8382a40 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -184,13 +184,14 @@ const WindowTitle = GObject.registerClass({
_updateIcon() {
let app = Shell.WindowTracker.get_default().get_window_app(this._metaWindow);
- if (app)
+ if (app) {
this._icon.child = app.create_icon_texture(ICON_TEXTURE_SIZE);
- else
+ } else {
this._icon.child = new St.Icon({
icon_name: 'icon-missing',
icon_size: ICON_TEXTURE_SIZE
});
+ }
}
_onDestroy() {
diff --git a/extensions/window-list/windowPicker.js b/extensions/window-list/windowPicker.js
index bfac17f..12bab76 100644
--- a/extensions/window-list/windowPicker.js
+++ b/extensions/window-list/windowPicker.js
@@ -24,9 +24,10 @@ let MyWorkspacesDisplay = class extends WorkspacesDisplay {
}
show(...args) {
- if (this._scrollEventId == 0)
+ if (this._scrollEventId == 0) {
this._scrollEventId = Main.windowPicker.connect('scroll-event',
this._onScrollEvent.bind(this));
+ }
super.show(...args);
}
diff --git a/extensions/window-list/workspaceIndicator.js b/extensions/window-list/workspaceIndicator.js
index 33b2e49..eb1f569 100644
--- a/extensions/window-list/workspaceIndicator.js
+++ b/extensions/window-list/workspaceIndicator.js
@@ -382,13 +382,12 @@ var WorkspaceIndicator = GObject.registerClass({
_onScrollEvent(actor, event) {
let direction = event.get_scroll_direction();
let diff = 0;
- if (direction == Clutter.ScrollDirection.DOWN) {
+ if (direction == Clutter.ScrollDirection.DOWN)
diff = 1;
- } else if (direction == Clutter.ScrollDirection.UP) {
+ else if (direction == Clutter.ScrollDirection.UP)
diff = -1;
- } else {
+ else
return;
- }
let newIndex = this._currentWorkspace + diff;
this._activate(newIndex);
diff --git a/extensions/windowsNavigator/extension.js b/extensions/windowsNavigator/extension.js
index fe7a826..9481198 100644
--- a/extensions/windowsNavigator/extension.js
+++ b/extensions/windowsNavigator/extension.js
@@ -55,8 +55,9 @@ var MyWorkspace = class extends Workspace.Workspace {
this.actor.connect('notify::scale-x', () => {
this._tip.set_scale(1 / this.actor.scale_x, 1 / this.actor.scale_x);
});
- } else
+ } else {
this._tip = null;
+ }
}
showTooltip() {
diff --git a/extensions/workspace-indicator/extension.js b/extensions/workspace-indicator/extension.js
index 338044d..ef558c3 100644
--- a/extensions/workspace-indicator/extension.js
+++ b/extensions/workspace-indicator/extension.js
@@ -387,13 +387,13 @@ class WorkspaceIndicator extends PanelMenu.Button {
_onScrollEvent(actor, event) {
let direction = event.get_scroll_direction();
let diff = 0;
- if (direction == Clutter.ScrollDirection.DOWN) {
+ if (direction == Clutter.ScrollDirection.DOWN)
diff = 1;
- } else if (direction == Clutter.ScrollDirection.UP) {
+ else if (direction == Clutter.ScrollDirection.UP)
diff = -1;
- } else {
+ else
return;
- }
+
let newIndex = global.workspace_manager.get_active_workspace_index() + diff;
this._activate(newIndex);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]