cleanup: Avoid unnecessary braces
Our coding style has always been to avoid braces when all blocks are single-lines. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:

committed by
Georges Basile Stavracas Neto

parent
69f63dc94f
commit
67ea424525
@ -722,9 +722,9 @@ class AppSwitcher extends SwitcherPopup.SwitcherList {
|
||||
|
||||
_setIconSize() {
|
||||
let j = 0;
|
||||
while (this._items.length > 1 && this._items[j].style_class != 'item-box') {
|
||||
while (this._items.length > 1 && this._items[j].style_class != 'item-box')
|
||||
j++;
|
||||
}
|
||||
|
||||
let themeNode = this._items[j].get_theme_node();
|
||||
this._list.ensure_style();
|
||||
|
||||
|
@ -110,9 +110,8 @@ function _findBestFolderName(apps) {
|
||||
// If a category is present in all apps, its counter will
|
||||
// reach appInfos.length
|
||||
if (category.length > 0 &&
|
||||
categoryCounter[category] == appInfos.length) {
|
||||
categoryCounter[category] == appInfos.length)
|
||||
categories.push(category);
|
||||
}
|
||||
}
|
||||
return categories;
|
||||
}, commonCategories);
|
||||
@ -764,9 +763,8 @@ var AllView = GObject.registerClass({
|
||||
|
||||
// Within the grid boundaries, or already animating
|
||||
if (dragEvent.y > gridY && dragEvent.y < gridBottom ||
|
||||
this._adjustment.get_transition('value') != null) {
|
||||
this._adjustment.get_transition('value') != null)
|
||||
return;
|
||||
}
|
||||
|
||||
// Moving above the grid
|
||||
let currentY = this._adjustment.value;
|
||||
@ -777,9 +775,8 @@ var AllView = GObject.registerClass({
|
||||
|
||||
// Moving below the grid
|
||||
let maxY = this._adjustment.upper - this._adjustment.page_size;
|
||||
if (dragEvent.y >= gridBottom && currentY < maxY) {
|
||||
if (dragEvent.y >= gridBottom && currentY < maxY)
|
||||
this.goToPage(this._grid.currentPage + 1);
|
||||
}
|
||||
}
|
||||
|
||||
_onDragBegin() {
|
||||
@ -2257,11 +2254,10 @@ var AppIcon = GObject.registerClass({
|
||||
}
|
||||
|
||||
activateWindow(metaWindow) {
|
||||
if (metaWindow) {
|
||||
if (metaWindow)
|
||||
Main.activateWindow(metaWindow);
|
||||
} else {
|
||||
else
|
||||
Main.overview.hide();
|
||||
}
|
||||
}
|
||||
|
||||
_onMenuPoppedDown() {
|
||||
|
@ -269,9 +269,9 @@ var Background = GObject.registerClass({
|
||||
|
||||
let i;
|
||||
let keys = Object.keys(this._fileWatches);
|
||||
for (i = 0; i < keys.length; i++) {
|
||||
for (i = 0; i < keys.length; i++)
|
||||
this._cache.disconnect(this._fileWatches[keys[i]]);
|
||||
}
|
||||
|
||||
this._fileWatches = null;
|
||||
|
||||
if (this._timezoneChangedId != 0)
|
||||
|
@ -247,11 +247,10 @@ var BoxPointer = GObject.registerClass({
|
||||
let [absX, absY] = this.get_transformed_position();
|
||||
|
||||
if (this._arrowSide == St.Side.TOP ||
|
||||
this._arrowSide == St.Side.BOTTOM) {
|
||||
this._arrowSide == St.Side.BOTTOM)
|
||||
this._arrowOrigin = sourceX - absX + sourceWidth / 2;
|
||||
} else {
|
||||
else
|
||||
this._arrowOrigin = sourceY - absY + sourceHeight / 2;
|
||||
}
|
||||
}
|
||||
|
||||
let borderWidth = themeNode.get_length('-arrow-border-width');
|
||||
@ -266,20 +265,19 @@ var BoxPointer = GObject.registerClass({
|
||||
|
||||
let [width, height] = area.get_surface_size();
|
||||
let [boxWidth, boxHeight] = [width, height];
|
||||
if (this._arrowSide == St.Side.TOP || this._arrowSide == St.Side.BOTTOM) {
|
||||
if (this._arrowSide == St.Side.TOP || this._arrowSide == St.Side.BOTTOM)
|
||||
boxHeight -= rise;
|
||||
} else {
|
||||
else
|
||||
boxWidth -= rise;
|
||||
}
|
||||
|
||||
let cr = area.get_context();
|
||||
|
||||
// Translate so that box goes from 0,0 to boxWidth,boxHeight,
|
||||
// with the arrow poking out of that
|
||||
if (this._arrowSide == St.Side.TOP) {
|
||||
if (this._arrowSide == St.Side.TOP)
|
||||
cr.translate(0, rise);
|
||||
} else if (this._arrowSide == St.Side.LEFT) {
|
||||
else if (this._arrowSide == St.Side.LEFT)
|
||||
cr.translate(rise, 0);
|
||||
}
|
||||
|
||||
let [x1, y1] = [halfBorder, halfBorder];
|
||||
let [x2, y2] = [boxWidth - halfBorder, boxHeight - halfBorder];
|
||||
|
@ -326,9 +326,8 @@ class DBusEventSource extends EventSourceBase {
|
||||
for (let n = 0; n < this._events.length; n++) {
|
||||
let event = this._events[n];
|
||||
|
||||
if (_dateIntervalsOverlap (event.date, event.end, begin, end)) {
|
||||
if (_dateIntervalsOverlap(event.date, event.end, begin, end))
|
||||
result.push(event);
|
||||
}
|
||||
}
|
||||
result.sort((event1, event2) => {
|
||||
// sort events by end time on ending day
|
||||
|
@ -58,9 +58,8 @@ var AutomountManager = class {
|
||||
_InhibitorsChanged(_object, _senderName, [_inhibitor]) {
|
||||
this._session.IsInhibitedRemote(GNOME_SESSION_AUTOMOUNT_INHIBIT,
|
||||
(result, error) => {
|
||||
if (!error) {
|
||||
if (!error)
|
||||
this._inhibited = result[0];
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -245,11 +245,10 @@ var AutorunDispatcher = class {
|
||||
let success = false;
|
||||
let app = null;
|
||||
|
||||
if (setting == AutorunSetting.RUN) {
|
||||
if (setting == AutorunSetting.RUN)
|
||||
app = Gio.app_info_get_default_for_type(contentTypes[0], false);
|
||||
} else if (setting == AutorunSetting.FILES) {
|
||||
else if (setting == AutorunSetting.FILES)
|
||||
app = Gio.app_info_get_default_for_type('inode/directory', false);
|
||||
}
|
||||
|
||||
if (app)
|
||||
success = startAppForMount(app, mount);
|
||||
|
@ -349,11 +349,10 @@ class ChatSource extends MessageTray.Source {
|
||||
|
||||
getIcon() {
|
||||
let file = this._contact.get_avatar_file();
|
||||
if (file) {
|
||||
if (file)
|
||||
return new Gio.FileIcon({ file: file });
|
||||
} else {
|
||||
else
|
||||
return new Gio.ThemedIcon({ name: 'avatar-default' });
|
||||
}
|
||||
}
|
||||
|
||||
getSecondaryIcon() {
|
||||
|
@ -16,11 +16,10 @@ var DASH_ITEM_LABEL_HIDE_TIME = 100;
|
||||
var DASH_ITEM_HOVER_TIMEOUT = 300;
|
||||
|
||||
function getAppFromSource(source) {
|
||||
if (source instanceof AppDisplay.AppIcon) {
|
||||
if (source instanceof AppDisplay.AppIcon)
|
||||
return source.app;
|
||||
} else {
|
||||
else
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
var DashIcon = GObject.registerClass(
|
||||
@ -755,9 +754,8 @@ var Dash = GObject.registerClass({
|
||||
if (!this._shownInitially)
|
||||
this._shownInitially = true;
|
||||
|
||||
for (let i = 0; i < addedItems.length; i++) {
|
||||
for (let i = 0; i < addedItems.length; i++)
|
||||
addedItems[i].item.show(animate);
|
||||
}
|
||||
|
||||
// Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=692744
|
||||
// Without it, StBoxLayout may use a stale size cache
|
||||
@ -865,9 +863,8 @@ var Dash = GObject.registerClass({
|
||||
let app = getAppFromSource(source);
|
||||
|
||||
// Don't allow favoriting of transient apps
|
||||
if (app == null || app.is_window_backed()) {
|
||||
if (app == null || app.is_window_backed())
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!global.settings.is_writable('favorite-apps'))
|
||||
return false;
|
||||
|
@ -635,11 +635,11 @@ class DateMenuButton extends PanelMenu.Button {
|
||||
_sessionUpdated() {
|
||||
let eventSource;
|
||||
let showEvents = Main.sessionMode.showCalendarEvents;
|
||||
if (showEvents) {
|
||||
if (showEvents)
|
||||
eventSource = this._getEventSource();
|
||||
} else {
|
||||
else
|
||||
eventSource = new Calendar.EmptyEventSource();
|
||||
}
|
||||
|
||||
this._setEventSource(eventSource);
|
||||
|
||||
// Displays are not actually expected to launch Settings when activated
|
||||
|
@ -258,11 +258,11 @@ var _Draggable = class _Draggable {
|
||||
} else if (event.type() == Clutter.EventType.MOTION ||
|
||||
(event.type() == Clutter.EventType.TOUCH_UPDATE &&
|
||||
global.display.is_pointer_emulating_sequence(event.get_event_sequence()))) {
|
||||
if (this._dragActor && this._dragState == DragState.DRAGGING) {
|
||||
if (this._dragActor && this._dragState == DragState.DRAGGING)
|
||||
return this._updateDragPosition(event);
|
||||
} else if (this._dragActor == null && this._dragState != DragState.CANCELLED) {
|
||||
else if (this._dragActor == null && this._dragState != DragState.CANCELLED)
|
||||
return this._maybeStartDrag(event);
|
||||
}
|
||||
|
||||
// We intercept KEY_PRESS event so that we can process Esc key press to cancel
|
||||
// dragging and ignore all other key presses.
|
||||
} else if (event.type() == Clutter.EventType.KEY_PRESS && this._dragState == DragState.DRAGGING) {
|
||||
|
@ -200,9 +200,8 @@ var ExtensionManager = class {
|
||||
|
||||
createExtensionObject(uuid, dir, type) {
|
||||
let metadataFile = dir.get_child('metadata.json');
|
||||
if (!metadataFile.query_exists(null)) {
|
||||
if (!metadataFile.query_exists(null))
|
||||
throw new Error('Missing metadata.json');
|
||||
}
|
||||
|
||||
let metadataContents, success_;
|
||||
try {
|
||||
@ -222,14 +221,12 @@ var ExtensionManager = class {
|
||||
let requiredProperties = ['uuid', 'name', 'description', 'shell-version'];
|
||||
for (let i = 0; i < requiredProperties.length; i++) {
|
||||
let prop = requiredProperties[i];
|
||||
if (!meta[prop]) {
|
||||
if (!meta[prop])
|
||||
throw new Error(`missing "${prop}" property in metadata.json`);
|
||||
}
|
||||
}
|
||||
|
||||
if (uuid != meta.uuid) {
|
||||
if (uuid != meta.uuid)
|
||||
throw new Error(`uuid "${meta.uuid}" from metadata.json does not match directory name "${uuid}"`);
|
||||
}
|
||||
|
||||
let extension = {
|
||||
metadata: meta,
|
||||
|
@ -815,9 +815,9 @@ var IconGrid = GObject.registerClass({
|
||||
this._updateIconSizesLaterId = 0;
|
||||
let scale = Math.min(this._fixedHItemSize, this._fixedVItemSize) / Math.max(this._hItemSize, this._vItemSize);
|
||||
let newIconSize = Math.floor(ICON_SIZE * scale);
|
||||
for (let i in this._items) {
|
||||
for (let i in this._items)
|
||||
this._items[i].icon.setIconSize(newIconSize);
|
||||
}
|
||||
|
||||
return GLib.SOURCE_REMOVE;
|
||||
}
|
||||
});
|
||||
@ -879,9 +879,9 @@ var PaginatedIconGrid = GObject.registerClass({
|
||||
children[i].show();
|
||||
|
||||
columnIndex++;
|
||||
if (columnIndex == nColumns) {
|
||||
if (columnIndex == nColumns)
|
||||
columnIndex = 0;
|
||||
}
|
||||
|
||||
if (columnIndex == 0) {
|
||||
y += this._getVItemSize() + spacing;
|
||||
if ((i + 1) % this._childrenPerPage == 0)
|
||||
|
@ -311,9 +311,8 @@ var Key = GObject.registerClass({
|
||||
_press(key) {
|
||||
this.emit('activated');
|
||||
|
||||
if (key != this.key || this._extended_keys.length == 0) {
|
||||
if (key != this.key || this._extended_keys.length == 0)
|
||||
this.emit('pressed', this._getKeyval(key), key);
|
||||
}
|
||||
|
||||
if (key == this.key) {
|
||||
this._pressTimeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT,
|
||||
|
@ -54,9 +54,9 @@ var AutoComplete = class AutoComplete {
|
||||
}
|
||||
|
||||
_processCompletionRequest(event) {
|
||||
if (event.completions.length == 0) {
|
||||
if (event.completions.length == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
// Unique match = go ahead and complete; multiple matches + single tab = complete the common starting string;
|
||||
// multiple matches + double tab = emit a suggest event with all possible options
|
||||
if (event.completions.length == 1) {
|
||||
@ -78,10 +78,10 @@ var AutoComplete = class AutoComplete {
|
||||
_entryKeyPressEvent(actor, event) {
|
||||
let cursorPos = this._entry.clutter_text.get_cursor_position();
|
||||
let text = this._entry.get_text();
|
||||
if (cursorPos != -1) {
|
||||
if (cursorPos != -1)
|
||||
text = text.slice(0, cursorPos);
|
||||
}
|
||||
if (event.get_key_symbol() === Clutter.KEY_Tab) {
|
||||
|
||||
if (event.get_key_symbol() == Clutter.KEY_Tab) {
|
||||
let [completions, attrHead] = JsParse.getCompletions(text, commandHeader, AUTO_COMPLETE_GLOBAL_KEYWORDS);
|
||||
let currTime = global.get_current_time();
|
||||
if ((currTime - this._lastTabTime) < AUTO_COMPLETE_DOUBLE_TAB_DELAY) {
|
||||
@ -224,18 +224,16 @@ var Notebook = GObject.registerClass({
|
||||
|
||||
nextTab() {
|
||||
let nextIndex = this._selectedIndex;
|
||||
if (nextIndex < this._tabs.length - 1) {
|
||||
if (nextIndex < this._tabs.length - 1)
|
||||
++nextIndex;
|
||||
}
|
||||
|
||||
this.selectIndex(nextIndex);
|
||||
}
|
||||
|
||||
prevTab() {
|
||||
let prevIndex = this._selectedIndex;
|
||||
if (prevIndex > 0) {
|
||||
if (prevIndex > 0)
|
||||
--prevIndex;
|
||||
}
|
||||
|
||||
this.selectIndex(prevIndex);
|
||||
}
|
||||
@ -412,9 +410,8 @@ class ObjInspector extends St.ScrollView {
|
||||
hbox.add(button);
|
||||
if (typeof obj == typeof {}) {
|
||||
let properties = [];
|
||||
for (let propName in obj) {
|
||||
for (let propName in obj)
|
||||
properties.push(propName);
|
||||
}
|
||||
properties.sort();
|
||||
|
||||
for (let i = 0; i < properties.length; i++) {
|
||||
@ -1096,21 +1093,19 @@ class LookingGlass extends St.BoxLayout {
|
||||
// Handle key events which are relevant for all tabs of the LookingGlass
|
||||
vfunc_key_press_event(keyPressEvent) {
|
||||
let symbol = keyPressEvent.keyval;
|
||||
if (symbol === Clutter.KEY_Escape) {
|
||||
if (this._objInspector.visible) {
|
||||
if (symbol == Clutter.KEY_Escape) {
|
||||
if (this._objInspector.visible)
|
||||
this._objInspector.close();
|
||||
} else {
|
||||
else
|
||||
this.close();
|
||||
}
|
||||
return Clutter.EVENT_STOP;
|
||||
}
|
||||
// Ctrl+PgUp and Ctrl+PgDown switches tabs in the notebook view
|
||||
if (keyPressEvent.modifier_state & Clutter.ModifierType.CONTROL_MASK) {
|
||||
if (symbol == Clutter.KEY_Page_Up) {
|
||||
if (symbol == Clutter.KEY_Page_Up)
|
||||
this._notebook.prevTab();
|
||||
} else if (symbol == Clutter.KEY_Page_Down) {
|
||||
else if (symbol == Clutter.KEY_Page_Down)
|
||||
this._notebook.nextTab();
|
||||
}
|
||||
}
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
}
|
||||
|
@ -623,9 +623,8 @@ var Magnifier = class Magnifier {
|
||||
|
||||
_updateLensMode() {
|
||||
// Applies only to the first zoom region.
|
||||
if (this._zoomRegions.length) {
|
||||
if (this._zoomRegions.length)
|
||||
this._zoomRegions[0].setLensMode(this._settings.get_boolean(LENS_MODE_KEY));
|
||||
}
|
||||
}
|
||||
|
||||
_updateClampMode() {
|
||||
@ -1182,9 +1181,8 @@ var ZoomRegion = class ZoomRegion {
|
||||
|
||||
// If the crossHairs is not already within a larger container, add it
|
||||
// to this zoom region. Otherwise, add a clone.
|
||||
if (crossHairs && this.isActive()) {
|
||||
if (crossHairs && this.isActive())
|
||||
this._crossHairsActor = crossHairs.addToZoomRegion(this, this._mouseActor);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1448,13 +1446,12 @@ var ZoomRegion = class ZoomRegion {
|
||||
let xMouse = this._magnifier.xMouse;
|
||||
let yMouse = this._magnifier.yMouse;
|
||||
|
||||
if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PROPORTIONAL) {
|
||||
if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PROPORTIONAL)
|
||||
return this._centerFromPointProportional(xMouse, yMouse);
|
||||
} else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PUSH) {
|
||||
else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.PUSH)
|
||||
return this._centerFromPointPush(xMouse, yMouse);
|
||||
} else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.CENTERED) {
|
||||
else if (this._mouseTrackingMode == GDesktopEnums.MagnifierMouseTrackingMode.CENTERED)
|
||||
return this._centerFromPointCentered(xMouse, yMouse);
|
||||
}
|
||||
|
||||
return null; // Should never be hit
|
||||
}
|
||||
|
@ -248,12 +248,12 @@ function _initializeUI() {
|
||||
}
|
||||
|
||||
layoutManager.connect('startup-complete', () => {
|
||||
if (actionMode == Shell.ActionMode.NONE) {
|
||||
if (actionMode == Shell.ActionMode.NONE)
|
||||
actionMode = Shell.ActionMode.NORMAL;
|
||||
}
|
||||
if (screenShield) {
|
||||
|
||||
if (screenShield)
|
||||
screenShield.lockIfWasLocked();
|
||||
}
|
||||
|
||||
if (sessionMode.currentMode != 'gdm' &&
|
||||
sessionMode.currentMode != 'initial-setup') {
|
||||
GLib.log_structured(LOG_DOMAIN, GLib.LogLevelFlags.LEVEL_MESSAGE, {
|
||||
@ -573,16 +573,16 @@ function popModal(actor, timestamp) {
|
||||
}
|
||||
|
||||
function createLookingGlass() {
|
||||
if (lookingGlass == null) {
|
||||
if (lookingGlass == null)
|
||||
lookingGlass = new LookingGlass.LookingGlass();
|
||||
}
|
||||
|
||||
return lookingGlass;
|
||||
}
|
||||
|
||||
function openRunDialog() {
|
||||
if (runDialog == null) {
|
||||
if (runDialog == null)
|
||||
runDialog = new RunDialog.RunDialog();
|
||||
}
|
||||
|
||||
runDialog.open();
|
||||
}
|
||||
|
||||
|
@ -856,11 +856,10 @@ var Source = GObject.registerClass({
|
||||
notification.acknowledged = false;
|
||||
this.pushNotification(notification);
|
||||
|
||||
if (this.policy.showBanners || notification.urgency == Urgency.CRITICAL) {
|
||||
if (this.policy.showBanners || notification.urgency == Urgency.CRITICAL)
|
||||
this.emit('notification-show', notification);
|
||||
} else {
|
||||
else
|
||||
notification.playSound();
|
||||
}
|
||||
}
|
||||
|
||||
notify(propName) {
|
||||
|
@ -179,11 +179,10 @@ class SlidingControl extends St.Widget {
|
||||
let translation = this._getTranslation();
|
||||
|
||||
let shouldShow = (this._getSlide() > 0);
|
||||
if (shouldShow) {
|
||||
if (shouldShow)
|
||||
translationStart = translation;
|
||||
} else {
|
||||
else
|
||||
translationEnd = translation;
|
||||
}
|
||||
|
||||
if (this.layout.translation_x == translationEnd)
|
||||
return;
|
||||
|
@ -708,16 +708,15 @@ class AggregateMenu extends PanelMenu.Button {
|
||||
this._indicators = new St.BoxLayout({ style_class: 'panel-status-indicators-box' });
|
||||
this.add_child(this._indicators);
|
||||
|
||||
if (Config.HAVE_NETWORKMANAGER) {
|
||||
if (Config.HAVE_NETWORKMANAGER)
|
||||
this._network = new imports.ui.status.network.NMApplet();
|
||||
} else {
|
||||
else
|
||||
this._network = null;
|
||||
}
|
||||
if (Config.HAVE_BLUETOOTH) {
|
||||
|
||||
if (Config.HAVE_BLUETOOTH)
|
||||
this._bluetooth = new imports.ui.status.bluetooth.Indicator();
|
||||
} else {
|
||||
else
|
||||
this._bluetooth = null;
|
||||
}
|
||||
|
||||
this._remoteAccess = new imports.ui.status.remoteAccess.RemoteAccessApplet();
|
||||
this._power = new imports.ui.status.power.Indicator();
|
||||
@ -734,12 +733,10 @@ class AggregateMenu extends PanelMenu.Button {
|
||||
this._indicators.add_child(this._screencast);
|
||||
this._indicators.add_child(this._location);
|
||||
this._indicators.add_child(this._nightLight);
|
||||
if (this._network) {
|
||||
if (this._network)
|
||||
this._indicators.add_child(this._network);
|
||||
}
|
||||
if (this._bluetooth) {
|
||||
if (this._bluetooth)
|
||||
this._indicators.add_child(this._bluetooth);
|
||||
}
|
||||
this._indicators.add_child(this._remoteAccess);
|
||||
this._indicators.add_child(this._rfkill);
|
||||
this._indicators.add_child(this._volume);
|
||||
@ -749,12 +746,12 @@ class AggregateMenu extends PanelMenu.Button {
|
||||
this.menu.addMenuItem(this._volume.menu);
|
||||
this.menu.addMenuItem(this._brightness.menu);
|
||||
this.menu.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
|
||||
if (this._network) {
|
||||
if (this._network)
|
||||
this.menu.addMenuItem(this._network.menu);
|
||||
}
|
||||
if (this._bluetooth) {
|
||||
|
||||
if (this._bluetooth)
|
||||
this.menu.addMenuItem(this._bluetooth.menu);
|
||||
}
|
||||
|
||||
this.menu.addMenuItem(this._remoteAccess.menu);
|
||||
this.menu.addMenuItem(this._location.menu);
|
||||
this.menu.addMenuItem(this._rfkill.menu);
|
||||
|
@ -175,11 +175,10 @@ class RunDialog extends ModalDialog.ModalDialog {
|
||||
}
|
||||
|
||||
_getCompletion(text) {
|
||||
if (text.includes('/')) {
|
||||
if (text.includes('/'))
|
||||
return this._pathCompleter.get_completion_suffix(text);
|
||||
} else {
|
||||
else
|
||||
return this._getCommandCompletion(text);
|
||||
}
|
||||
}
|
||||
|
||||
_run(input, inTerminal) {
|
||||
|
@ -123,9 +123,8 @@ var NotificationsBox = GObject.registerClass({
|
||||
}
|
||||
|
||||
let items = this._sources.entries();
|
||||
for (let [source, obj] of items) {
|
||||
for (let [source, obj] of items)
|
||||
this._removeSource(source, obj);
|
||||
}
|
||||
}
|
||||
|
||||
_updateVisibility() {
|
||||
@ -205,11 +204,10 @@ var NotificationsBox = GObject.registerClass({
|
||||
}
|
||||
|
||||
_showSource(source, obj, box) {
|
||||
if (obj.detailed) {
|
||||
if (obj.detailed)
|
||||
[obj.titleLabel, obj.countLabel] = this._makeNotificationDetailedSource(source, box);
|
||||
} else {
|
||||
else
|
||||
[obj.titleLabel, obj.countLabel] = this._makeNotificationSource(source, box);
|
||||
}
|
||||
|
||||
box.visible = obj.visible && (source.unseenCount > 0);
|
||||
}
|
||||
@ -704,9 +702,8 @@ var ScreenShield = class {
|
||||
this._lockScreenScrollCounter += delta;
|
||||
|
||||
// 7 standard scrolls to lift up
|
||||
if (this._lockScreenScrollCounter > 35) {
|
||||
if (this._lockScreenScrollCounter > 35)
|
||||
this._liftShield(true, 0);
|
||||
}
|
||||
|
||||
return Clutter.EVENT_STOP;
|
||||
}
|
||||
|
@ -87,9 +87,8 @@ class ListSearchResult extends SearchResult {
|
||||
|
||||
// An icon for, or thumbnail of, content
|
||||
let icon = this.metaInfo['createIcon'](this.ICON_SIZE);
|
||||
if (icon) {
|
||||
if (icon)
|
||||
titleBox.add(icon);
|
||||
}
|
||||
|
||||
let title = new St.Label({
|
||||
text: this.metaInfo['name'],
|
||||
@ -689,11 +688,10 @@ var SearchResultsView = GObject.registerClass({
|
||||
this._statusBin.visible = !haveResults;
|
||||
|
||||
if (!haveResults) {
|
||||
if (this.searchInProgress) {
|
||||
if (this.searchInProgress)
|
||||
this._statusText.set_text(_("Searching…"));
|
||||
} else {
|
||||
else
|
||||
this._statusText.set_text(_("No results."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -362,9 +362,8 @@ var NMConnectionDevice = class NMConnectionDevice extends NMConnectionSection {
|
||||
if the reason is no secrets, as that indicates the user
|
||||
cancelled the agent dialog */
|
||||
if (newstate == NM.DeviceState.FAILED &&
|
||||
reason != NM.DeviceStateReason.NO_SECRETS) {
|
||||
reason != NM.DeviceStateReason.NO_SECRETS)
|
||||
this.emit('activation-failed', reason);
|
||||
}
|
||||
|
||||
this._sync();
|
||||
}
|
||||
@ -1053,9 +1052,8 @@ class NMWirelessDialog extends ModalDialog.ModalDialog {
|
||||
_checkConnections(network, accessPoint) {
|
||||
this._connections.forEach(connection => {
|
||||
if (accessPoint.connection_valid(connection) &&
|
||||
!network.connections.includes(connection)) {
|
||||
!network.connections.includes(connection))
|
||||
network.connections.push(connection);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -1241,9 +1239,8 @@ var NMDeviceWireless = class {
|
||||
if the reason is no secrets, as that indicates the user
|
||||
cancelled the agent dialog */
|
||||
if (newstate == NM.DeviceState.FAILED &&
|
||||
reason != NM.DeviceStateReason.NO_SECRETS) {
|
||||
reason != NM.DeviceStateReason.NO_SECRETS)
|
||||
this.emit('activation-failed', reason);
|
||||
}
|
||||
|
||||
this._sync();
|
||||
}
|
||||
@ -1511,9 +1508,9 @@ var NMVpnSection = class extends NMConnectionSection {
|
||||
|
||||
setActiveConnections(vpnConnections) {
|
||||
let connections = this._connectionItems.values();
|
||||
for (let item of connections) {
|
||||
for (let item of connections)
|
||||
item.setActiveConnection(null);
|
||||
}
|
||||
|
||||
vpnConnections.forEach(a => {
|
||||
if (a.connection) {
|
||||
let item = this._connectionItems.get(a.connection.get_uuid());
|
||||
|
@ -59,9 +59,8 @@ var StreamSlider = class {
|
||||
}
|
||||
|
||||
set stream(stream) {
|
||||
if (this._stream) {
|
||||
if (this._stream)
|
||||
this._disconnectStream(this._stream);
|
||||
}
|
||||
|
||||
this._stream = stream;
|
||||
|
||||
|
@ -85,11 +85,10 @@ var ShowOverviewAction = GObject.registerClass({
|
||||
for (let i = 0; i < this.get_n_current_points(); i++) {
|
||||
let x, y;
|
||||
|
||||
if (motion == true) {
|
||||
if (motion == true)
|
||||
[x, y] = this.get_motion_coords(i);
|
||||
} else {
|
||||
else
|
||||
[x, y] = this.get_press_coords(i);
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
minX = maxX = x;
|
||||
|
@ -1023,9 +1023,8 @@ var WindowManager = class {
|
||||
this._gsdWacomProxy = new GsdWacomProxy(Gio.DBus.session, GSD_WACOM_BUS_NAME,
|
||||
GSD_WACOM_OBJECT_PATH,
|
||||
(proxy, error) => {
|
||||
if (error) {
|
||||
if (error)
|
||||
log(error.message);
|
||||
}
|
||||
});
|
||||
|
||||
global.display.connect('pad-mode-switch', (display, pad, group, mode) => {
|
||||
@ -1170,9 +1169,8 @@ var WindowManager = class {
|
||||
|
||||
_lookupIndex(windows, metaWindow) {
|
||||
for (let i = 0; i < windows.length; i++) {
|
||||
if (windows[i].metaWindow == metaWindow) {
|
||||
if (windows[i].metaWindow == metaWindow)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
@ -1588,15 +1588,13 @@ class Workspace extends St.Widget {
|
||||
}
|
||||
|
||||
_windowEnteredMonitor(metaDisplay, monitorIndex, metaWin) {
|
||||
if (monitorIndex == this.monitorIndex) {
|
||||
if (monitorIndex == this.monitorIndex)
|
||||
this._doAddWindow(metaWin);
|
||||
}
|
||||
}
|
||||
|
||||
_windowLeftMonitor(metaDisplay, monitorIndex, metaWin) {
|
||||
if (monitorIndex == this.monitorIndex) {
|
||||
if (monitorIndex == this.monitorIndex)
|
||||
this._doRemoveWindow(metaWin);
|
||||
}
|
||||
}
|
||||
|
||||
// check for maximized windows on the workspace
|
||||
|
@ -293,9 +293,8 @@ var WorkspaceThumbnail = GObject.registerClass({
|
||||
this._allWindows.push(windows[i].meta_window);
|
||||
this._minimizedChangedIds.push(minimizedChangedId);
|
||||
|
||||
if (this._isMyWindow(windows[i]) && this._isOverviewWindow(windows[i])) {
|
||||
if (this._isMyWindow(windows[i]) && this._isOverviewWindow(windows[i]))
|
||||
this._addWindowClone(windows[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Track window changes
|
||||
@ -450,15 +449,13 @@ var WorkspaceThumbnail = GObject.registerClass({
|
||||
}
|
||||
|
||||
_windowEnteredMonitor(metaDisplay, monitorIndex, metaWin) {
|
||||
if (monitorIndex == this.monitorIndex) {
|
||||
if (monitorIndex == this.monitorIndex)
|
||||
this._doAddWindow(metaWin);
|
||||
}
|
||||
}
|
||||
|
||||
_windowLeftMonitor(metaDisplay, monitorIndex, metaWin) {
|
||||
if (monitorIndex == this.monitorIndex) {
|
||||
if (monitorIndex == this.monitorIndex)
|
||||
this._doRemoveWindow(metaWin);
|
||||
}
|
||||
}
|
||||
|
||||
_updateMinimized(metaWin) {
|
||||
|
Reference in New Issue
Block a user