[polari] Initialize properties early



commit a8b549b0f2195ba78833eb9058dd38f405202ef9
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Feb 16 19:51:20 2017 +0100

    Initialize properties early
    
    GObject properties may be accessed during construction, so set
    the backing JS properties before chaining up to the parent.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778793

 src/chatView.js    |    4 ++--
 src/connections.js |    2 ++
 src/userList.js    |    4 ++++
 3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index 05dbdab..8f9de8e 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -170,10 +170,10 @@ const ButtonTag = new Lang.Class({
     },
 
     _init: function(params) {
-        this.parent(params);
-
         this._hover = false;
         this._pressed = false;
+
+        this.parent(params);
     },
 
     get hover() {
diff --git a/src/connections.js b/src/connections.js
index 395fa7d..871807a 100644
--- a/src/connections.js
+++ b/src/connections.js
@@ -223,6 +223,8 @@ const ConnectionDetails = new Lang.Class({
                 this.notify('has-service');
             }));
 
+        this._account = null;
+
         this.parent(params);
 
         this._nameEntry.connect('changed',
diff --git a/src/userList.js b/src/userList.js
index 2456d7c..4703da1 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -131,6 +131,7 @@ const UserDetails = new Lang.Class({
 
         this._expanded = false;
         this._initialDetailsLoaded = false;
+        this._user = null;
 
         this.parent(params);
 
@@ -340,6 +341,9 @@ const UserPopover = new Lang.Class({
         this._userTracker = params.userTracker;
         delete params.userTracker;
 
+        this._nickname = null;
+        this._basenick = null;
+
         this.parent(params);
 
         this._nickLabel.set_state_flags(Gtk.StateFlags.LINK, false);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]