[polari/wip/fmuellner/roomlist-filtering: 4/12] serverRoomList: Remove :loading property
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/roomlist-filtering: 4/12] serverRoomList: Remove :loading property
- Date: Mon, 13 Mar 2017 02:51:09 +0000 (UTC)
commit edffe41e11d3dcc15d444f8a0fd03c6e53f991b0
Author: Florian Müllner <fmuellner gnome org>
Date: Sat Mar 11 23:15:36 2017 +0100
serverRoomList: Remove :loading property
Now that the spinner is an internal child, we can simply update it
as necessary instead of routing through a GObject property.
https://bugzilla.gnome.org/show_bug.cgi?id=779940
src/serverRoomManager.js | 25 +++++++++----------------
1 files changed, 9 insertions(+), 16 deletions(-)
---
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index 17003ab..80ada91 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -118,11 +118,6 @@ const ServerRoomList = new Lang.Class({
'can-join',
'can-join',
GObject.ParamFlags.READABLE,
- false),
- 'loading': GObject.ParamSpec.boolean('loading',
- 'loading',
- 'loading',
- GObject.ParamFlags.READABLE,
false)
},
@@ -148,9 +143,6 @@ const ServerRoomList = new Lang.Class({
this._toggleChecked(path);
});
- this.bind_property('loading', this._spinner, 'active',
- GObject.BindingFlags.SYNC_CREATE);
-
this._manager = getDefault();
this._manager.connect('loading-changed',
Lang.bind(this, this._onLoadingChanged));
@@ -169,11 +161,6 @@ const ServerRoomList = new Lang.Class({
return canJoin;
},
- get loading() {
- return this._pendingInfos.length ||
- (this._account && this._manager.isLoading(this._account));
- },
-
get selectedRooms() {
let rooms = [];
@@ -209,7 +196,7 @@ const ServerRoomList = new Lang.Class({
if (account != this._account)
return;
- this.notify('loading');
+ this._checkSpinner();
if (this.loading)
return;
@@ -232,7 +219,7 @@ const ServerRoomList = new Lang.Class({
});
this._pendingInfos = roomInfos;
- this.notify('loading');
+ this._checkSpinner();
let roomManager = RoomManager.getDefault();
@@ -260,11 +247,17 @@ const ServerRoomList = new Lang.Class({
return GLib.SOURCE_CONTINUE;
this._idleId = 0;
- this.notify('loading');
+ this._checkSpinner();
return GLib.SOURCE_REMOVE;
});
},
+ _checkSpinner: function() {
+ let loading = this._pendingInfos.length ||
+ (this._account && this._manager.isLoading(this._account));
+ this._spinner.active = loading;
+ },
+
_toggleChecked: function(path) {
let [valid, iter] = this._list.model.get_iter(path);
if (!this._list.model.get_value(iter, RoomListColumn.SENSITIVE))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]