[polari/wip/fmuellner/window-experiments: 18/24] chatroomManager: Add forEachRoom()
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari/wip/fmuellner/window-experiments: 18/24] chatroomManager: Add forEachRoom()
- Date: Mon, 18 Jul 2016 20:05:10 +0000 (UTC)
commit 172355e43d758d46835e9330486795dc8cfafdc7
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 e7d14ec..54a0ecc 100644
--- a/src/chatroomManager.js
+++ b/src/chatroomManager.js
@@ -487,6 +487,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]