Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vmj-qt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
vmj-qt
Commits
ef96b952
Commit
ef96b952
authored
Apr 16, 2011
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed adding/removing notification observer
parent
3560deab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
contacts.py
blink/contacts.py
+4
-1
No files found.
blink/contacts.py
View file @
ef96b952
...
...
@@ -300,7 +300,6 @@ class GoogleContactsManager(object):
self
.
_load_timer
=
None
notification_center
=
NotificationCenter
()
notification_center
.
add_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
,
sender
=
SIPSimpleSettings
())
notification_center
.
add_observer
(
self
,
name
=
'SIPApplicationWillStart'
)
notification_center
.
add_observer
(
self
,
name
=
'SIPApplicationWillEnd'
)
...
...
@@ -334,6 +333,8 @@ class GoogleContactsManager(object):
def
_NH_SIPApplicationWillStart
(
self
,
notification
):
settings
=
SIPSimpleSettings
()
notification_center
=
NotificationCenter
()
notification_center
.
add_observer
(
self
,
name
=
'CFGSettingsObjectDidChange'
,
sender
=
settings
)
authorization_token
=
settings
.
google_contacts
.
authorization_token
if
authorization_token
:
call_in_gui_thread
(
self
.
contact_model
.
addGroup
,
self
.
contact_model
.
google_contacts_group
)
...
...
@@ -359,6 +360,8 @@ class GoogleContactsManager(object):
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
())
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment