From 1ce29c2d7f3427861a2eb19351a5f7da8e93d619 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Tue, 12 Jun 2007 15:08:01 +0000 Subject: buddy: Don't emit validity-changed twice --- diff --git a/src/buddy.py b/src/buddy.py index 1629892..2e83270 100644 --- a/src/buddy.py +++ b/src/buddy.py @@ -532,17 +532,25 @@ class Buddy(ExportedGObject): self.set_properties(props) # If the properties didn't contain the key or color, then we're never # going to get one. - self._awaiting.discard('properties') - if not self._awaiting: - self.emit('validity-changed', True) + try: + self._awaiting.remove('properties') + except KeyError: + pass + else: + if not self._awaiting: + self.emit('validity-changed', True) def update_alias(self, tp, alias): """Update the alias from the given Telepathy connection. """ self.set_properties({'nick': alias}) - self._awaiting.discard('alias') - if not self._awaiting: - self.emit('validity-changed', True) + try: + self._awaiting.remove('alias') + except KeyError: + pass + else: + if not self._awaiting: + self.emit('validity-changed', True) def update_current_activity(self, tp, current_activity): """Update the current activity from the given Telepathy connection. -- cgit v0.9.1