Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2007-06-12 15:08:01 (GMT)
committer Simon McVittie <simon.mcvittie@collabora.co.uk>2007-06-12 15:08:01 (GMT)
commit1ce29c2d7f3427861a2eb19351a5f7da8e93d619 (patch)
tree1547663ba1e1dd25a1a9913902946762d815beda
parent6604076d22edc6fe8ebbaf1338047930919b087a (diff)
buddy: Don't emit validity-changed twice
-rw-r--r--src/buddy.py20
1 files changed, 14 insertions, 6 deletions
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.