[polari/wip/fmuellner/window-experiments: 20/29] chatroomManager: Add forEachRoom()
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/window-experiments: 20/29] chatroomManager: Add forEachRoom()
- Date: Tue, 19 Jul 2016 22:38:14 +0000 (UTC)
commit b148b67b182c922af2ca694800b101ffd7f215fd
Author: Florian Müllner <fmuellner gnome org>
Date: Thu Jul 14 16:44:41 2016 +0200
chatroomManager: Add forEachRoom()
Both the room list in the sidebar and the stack in the main content
area rely on the manager's ::room-added and ::room-removed signals
to keep track of rooms. This relies on no room having been added
before the signals were connected though, which won't be the case
for windows opened later. So add a small forEachRoom() method that
allows components to iterate over the list of added rooms so they
can pick them up.
src/chatroomManager.js | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/chatroomManager.js b/src/chatroomManager.js
index 62cabc1..dbc6109 100644
--- a/src/chatroomManager.js
+++ b/src/chatroomManager.js
@@ -486,6 +486,11 @@ const _ChatroomManager = new Lang.Class({
this._app.active_window.active_room = room;
},
+ forEachRoom: function(func) {
+ for (let room of this._rooms.values())
+ func(room);
+ },
+
getRoomByName: function(name) {
for (let room of this._rooms.values())
if (rooms.channel_name == name)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]