Commit a71c6f39 authored by Dan Pascu's avatar Dan Pascu

Reordered notification handlers

parent ef96b952
...@@ -342,6 +342,12 @@ class GoogleContactsManager(object): ...@@ -342,6 +342,12 @@ class GoogleContactsManager(object):
elif authorization_token is None: elif authorization_token is None:
self.remove_group() self.remove_group()
def _NH_SIPApplicationWillEnd(self, notification):
notification_center = NotificationCenter()
notification_center.remove_observer(self, name='CFGSettingsObjectDidChange', sender=SIPSimpleSettings())
if self.greenlet is not None:
api.kill(self.greenlet, api.GreenletExit())
def _NH_CFGSettingsObjectDidChange(self, notification): def _NH_CFGSettingsObjectDidChange(self, notification):
if 'google_contacts.authorization_token' in notification.data.modified: if 'google_contacts.authorization_token' in notification.data.modified:
if self._load_timer is not None and self._load_timer.active(): if self._load_timer is not None and self._load_timer.active():
...@@ -359,12 +365,6 @@ class GoogleContactsManager(object): ...@@ -359,12 +365,6 @@ class GoogleContactsManager(object):
self.stop_adding_contacts = False self.stop_adding_contacts = False
self.remove_group() self.remove_group()
def _NH_SIPApplicationWillEnd(self, notification):
notification_center = NotificationCenter()
notification_center.remove_observer(self, name='CFGSettingsObjectDidChange', sender=SIPSimpleSettings())
if self.greenlet is not None:
api.kill(self.greenlet, api.GreenletExit())
@run_in_green_thread @run_in_green_thread
def load_contacts(self): def load_contacts(self):
if self.greenlet is not None: if self.greenlet is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment