Twas brillig at 12:29:16 10.03.2007 UTC+01 when yann did gyre and gimble:

 y> Thanks for the patch. It's a good solution to handle events better
 y> in our code. I've modified your code a bit (integrate
 y> SystrayEventsListener class in Systray one) and commited it in rev
 y> 8008

Oops, I forgot to mail updated patch, last one had two bugs:

- 'fire_event_deleted' instead of 'fire_event_removed' once.

- 'fire_event_removed' may be called both with 'event' argument and
  without one, depending on the context, so let it accept and pass
  further optional 'event' argument.

See the fix in attach.

ps: I'm subscribed to gajim-devel, no need to copy answer to my address.

pps: Probably it worth to factor out publisher/subsriber snippet to
     the separate class and use it in everywhere. I'd do it if you
     agree that's a good idea.

Index: src/
--- src/	(revision 8008)
+++ src/	(working copy)
@@ -74,7 +74,7 @@
 		if event.show_in_systray:
-	def on_event_removed(self):
+	def on_event_removed(self, event):
 		'''Called when one or more events are removed from the event list'''
Index: src/common/
--- src/common/	(revision 8008)
+++ src/common/	(working copy)
@@ -74,9 +74,9 @@
 		for listener in self._event_added_listeners:
-	def fire_event_removed(self):
+	def fire_event_removed(self, event = None):
 		for listener in self._event_removed_listeners:
-			listener()
+			listener(event)
 	def change_account_name(self, old_name, new_name):
 		if self._events.has_key(old_name):
@@ -122,7 +122,7 @@
 					del self._events[account][jid]
-				self.fire_event_deleted(event)
+				self.fire_event_removed(event)
 				return True
Gajim-devel mailing list

Reply via email to