From 461bbcff153d7167d22bbf0e80ecbc5397d724cd Mon Sep 17 00:00:00 2001 From: Popax21 Date: Thu, 15 Oct 2020 15:14:55 +0000 Subject: [PATCH] modemManager: Add property getters gjs improved its default property getter/setters, and as a result it is no longer possible to set read-only properties. Add proper getters (backed by private properties) to fix the resulting errors. https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3203 --- js/misc/modemManager.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/js/misc/modemManager.js b/js/misc/modemManager.js index 0de0b24e2..5f727f3ca 100644 --- a/js/misc/modemManager.js +++ b/js/misc/modemManager.js @@ -111,17 +111,33 @@ var ModemBase = GObject.registerClass({ 0, 100, 0), }, }, class ModemBase extends GObject.Object { + _init() { + super._init(); + this._operatorName = null; + this._signalQuality = 0; + } + + // eslint-disable-next-line camelcase + get operator_name() { + return this._operatorName; + } + + // eslint-disable-next-line camelcase + get signal_quality() { + return this._signalQuality; + } + _setOperatorName(operatorName) { - if (this.operator_name == operatorName) + if (this._operatorName == operatorName) return; - this.operator_name = operatorName; + this._operatorName = operatorName; this.notify('operator-name'); } _setSignalQuality(signalQuality) { - if (this.signal_quality == signalQuality) + if (this._signalQuality == signalQuality) return; - this.signal_quality = signalQuality; + this._signalQuality = signalQuality; this.notify('signal-quality'); } });