[polari] roomList: Remove unnecessary signal disconnection



commit 81a36cc6200f3f04a6c1e1589efc737973b244d1
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Apr 20 14:08:22 2019 +0200

    roomList: Remove unnecessary signal disconnection
    
    The popover is destroyed with its :relative-to widget, so
    no need to disconnect signals explicitly.
    
    https://gitlab.gnome.org/GNOME/polari/merge_requests/121

 src/roomList.js | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/src/roomList.js b/src/roomList.js
index 9752fab..6933ac1 100644
--- a/src/roomList.js
+++ b/src/roomList.js
@@ -33,7 +33,6 @@ var RoomRow = GObject.registerClass({
         this._room = room;
         this._popover = null;
 
-        this._popoverVisibleChangedId = 0;
         this._connectingTimeoutId = 0;
 
         this._icon.gicon = room.icon;
@@ -61,10 +60,6 @@ var RoomRow = GObject.registerClass({
         }
 
         this.connect('destroy', () => {
-            if (this._popoverVisibleChangedId)
-                this._popover.disconnect(this._popoverVisibleChangedId);
-            this._popoverVisibleChangedId = 0;
-
             room.disconnect(channelChangedId);
             this._channelSignals.forEach(id => {
                 room.channel.disconnect(id);
@@ -196,9 +191,8 @@ var RoomRow = GObject.registerClass({
             menu.append(label, `app.leave-room(("${this._room.id}", ""))`);
 
             this._popover = Gtk.Popover.new_from_model(this, menu);
-            this._popoverVisibleChangedId =
-                this._popover.connect('notify::visible',
-                    _onPopoverVisibleChanged);
+            this._popover.connect('notify::visible',
+                _onPopoverVisibleChanged);
             this._popover.position = Gtk.PositionType.BOTTOM;
         }
         this._popover.show();


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