[gnome-shell] Initialize properties in _init()
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Initialize properties in _init()
- Date: Thu, 13 Jul 2017 15:25:48 +0000 (UTC)
commit 358133e82f6afbc93204555dde0100666af9222b
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Jun 13 04:24:12 2017 +0200
Initialize properties in _init()
While we've always considered it good style to initialize JS properties,
some code that relies on uninitialized properties having an implicit
value of 'undefined' has slipped in over time. The updated SpiderMonkey
version used by gjs now warns when accessing those properties, so we
should make sure that they are properly initialized to avoid log spam,
even though all warnings addressed here occur in conditionals that
produce the correct result with 'undefined'.
https://bugzilla.gnome.org/show_bug.cgi?id=781471
js/gdm/util.js | 4 ++++
js/ui/appDisplay.js | 3 +++
js/ui/lookingGlass.js | 1 +
js/ui/messageList.js | 7 +++++++
js/ui/remoteSearch.js | 1 +
js/ui/status/network.js | 1 +
js/ui/workspace.js | 1 +
7 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/js/gdm/util.js b/js/gdm/util.js
index 83ad422..667bbf1 100644
--- a/js/gdm/util.js
+++ b/js/gdm/util.js
@@ -128,6 +128,9 @@ const ShellUserVerifier = new Lang.Class({
this._client = client;
+ this._defaultService = null;
+ this._preemptingService = null;
+
this._settings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
this._settings.connect('changed',
Lang.bind(this, this._updateDefaultService));
@@ -140,6 +143,7 @@ const ShellUserVerifier = new Lang.Class({
// at startup should result in immediately initiating authentication.
// This is different than fingerprint readers, where we only check them
// after a user has been picked.
+ this.smartcardDetected = false;
this._checkForSmartcard();
this._smartcardInsertedId = this._smartcardManager.connect('smartcard-inserted',
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index c9541b4..b3970ae 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -1090,6 +1090,8 @@ const AppSearchProvider = new Lang.Class({
_init: function() {
this._appSys = Shell.AppSystem.get_default();
this.id = 'applications';
+ this.isRemoteProvider = false;
+ this.canLaunchSearch = false;
},
getResultMetas: function(apps, callback) {
@@ -1258,6 +1260,7 @@ const FolderIcon = new Lang.Class({
_init: function(id, path, parentView) {
this.id = id;
+ this.name = '';
this._parentView = parentView;
this._folder = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder',
diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js
index bb06c1b..ad33290 100644
--- a/js/ui/lookingGlass.js
+++ b/js/ui/lookingGlass.js
@@ -783,6 +783,7 @@ const LookingGlass = new Lang.Class({
this._open = false;
+ this._it = null;
this._offset = 0;
this._results = [];
diff --git a/js/ui/messageList.js b/js/ui/messageList.js
index 8175711..99fd09f 100644
--- a/js/ui/messageList.js
+++ b/js/ui/messageList.js
@@ -165,6 +165,11 @@ const ScaleLayout = new Lang.Class({
Name: 'ScaleLayout',
Extends: Clutter.BinLayout,
+ _init: function(params) {
+ this._container = null;
+ this.parent(params);
+ },
+
_connectContainer: function(container) {
if (this._container == container)
return;
@@ -299,6 +304,8 @@ const Message = new Lang.Class({
_init: function(title, body) {
this.expanded = false;
+ this._useBodyMarkup = false;
+
this.actor = new St.Button({ style_class: 'message',
accessible_role: Atk.Role.NOTIFICATION,
can_focus: true,
diff --git a/js/ui/remoteSearch.js b/js/ui/remoteSearch.js
index 4f376bc..dab2ad1 100644
--- a/js/ui/remoteSearch.js
+++ b/js/ui/remoteSearch.js
@@ -200,6 +200,7 @@ const RemoteSearchProvider = new Lang.Class({
this.appInfo = appInfo;
this.id = appInfo.get_id();
this.isRemoteProvider = true;
+ this.canLaunchSearch = false;
},
createIcon: function(size, meta) {
diff --git a/js/ui/status/network.js b/js/ui/status/network.js
index e86e89f..19c689b 100644
--- a/js/ui/status/network.js
+++ b/js/ui/status/network.js
@@ -1709,6 +1709,7 @@ const NMApplet = new Lang.Class({
this._mainConnection = null;
this._mainConnectionIconChangedId = 0;
+ this._mainConnectionStateChangedId = 0;
this._notification = null;
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index bcde53d..630e2f6 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -1100,6 +1100,7 @@ const Workspace = new Lang.Class({
_init : function(metaWorkspace, monitorIndex) {
// When dragging a window, we use this slot for reserve space.
this._reservedSlot = null;
+ this._reservedSlotWindow = null;
this.metaWorkspace = metaWorkspace;
// The full geometry is the geometry we should try and position
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]