[polari/wip/fmuellner/room-list: 12/12] Remove timeout again
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/room-list: 12/12] Remove timeout again
- Date: Sat, 10 Dec 2016 00:38:35 +0000 (UTC)
commit 2432aa8e6448930a42225801bf8310f8ca9263de
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Nov 28 19:21:02 2016 +0100
Remove timeout again
src/serverRoomManager.js | 51 +++++++++++++++++++---------------------------
1 files changed, 21 insertions(+), 30 deletions(-)
---
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index 893c46c..3171dbe 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -227,41 +227,32 @@ const ServerRoomList = new Lang.Class({
return count2 - count1;
return info1.get_name().localeCompare(info2.get_name());
});
- this._pendingInfos = roomInfos;
this.notify('loading');
let roomManager = RoomManager.getDefault();
-
- this._timeoutId = Mainloop.timeout_add(500, () => {
- this._pendingInfos.splice(0, 50).forEach(roomInfo => {
- let store = this._list.model;
-
- let name = roomInfo.get_name();
- if (name[0] == '#')
- name = name.substr(1, name.length);
-
- let room = roomManager.lookupRoomByName(roomInfo.get_name());
- let sensitive = room == null;
- let checked = !sensitive;
- let count = '%d'.format(roomInfo.get_members_count(null));
-
- store.insert_with_valuesv(-1,
- [RoomListColumn.CHECKED,
- RoomListColumn.NAME,
- RoomListColumn.COUNT,
- RoomListColumn.SENSITIVE],
- [checked, name, count, sensitive]);
-
- //row.connect('notify::checked', () => { this.notify('can-join'); });
- });
- if (this._pendingInfos.length)
- return GLib.SOURCE_CONTINUE;
-
- this._timeoutId = 0;
- this.notify('loading');
- return GLib.SOURCE_REMOVE;
+ roomInfos.forEach(roomInfo => {
+ let store = this._list.model;
+
+ let name = roomInfo.get_name();
+ if (name[0] == '#')
+ name = name.substr(1, name.length);
+
+ let room = roomManager.lookupRoomByName(roomInfo.get_name());
+ let sensitive = room == null;
+ let checked = !sensitive;
+ let count = '%d'.format(roomInfo.get_members_count(null));
+
+ store.insert_with_valuesv(-1,
+ [RoomListColumn.CHECKED,
+ RoomListColumn.NAME,
+ RoomListColumn.COUNT,
+ RoomListColumn.SENSITIVE],
+ [checked, name, count, sensitive]);
+
+ //row.connect('notify::checked', () => { this.notify('can-join'); });
});
+ this.notify('loading');
},
_toggleChecked: function(path) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]