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
2a98295e
Commit
2a98295e
authored
Feb 28, 2014
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added back reference to conference participant item
parent
bea7f5ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
sessions.py
blink/sessions.py
+4
-5
No files found.
blink/sessions.py
View file @
2a98295e
...
...
@@ -1460,11 +1460,7 @@ class ConferenceParticipantModel(QAbstractListModel):
self
.
addParticipant
(
ConferenceParticipantItem
(
notification
.
data
.
participant
))
def
_NH_BlinkSessionDidRemoveParticipant
(
self
,
notification
):
try
:
participant
=
next
(
item
for
item
in
self
.
participants
if
item
.
participant
is
notification
.
data
.
participant
)
# review this (check if it's worth keeping a mapping) -Dan
except
StopIteration
:
return
self
.
removeParticipant
(
participant
)
self
.
removeParticipant
(
notification
.
data
.
participant
.
participant_item
)
def
_NH_ConferenceParticipantItemDidChange
(
self
,
notification
):
index
=
self
.
index
(
self
.
participants
.
index
(
notification
.
sender
))
...
...
@@ -1494,6 +1490,7 @@ class ConferenceParticipantModel(QAbstractListModel):
def
addParticipant
(
self
,
participant
):
if
participant
in
self
.
participants
:
return
participant
.
participant
.
participant_item
=
participant
# add a back reference to this item so we can find it later without iterating all participants
self
.
participantAboutToBeAdded
.
emit
(
participant
)
self
.
_add_participant
(
participant
)
self
.
participantAdded
.
emit
(
participant
)
...
...
@@ -1505,6 +1502,7 @@ class ConferenceParticipantModel(QAbstractListModel):
return
notification_center
=
NotificationCenter
()
notification_center
.
remove_observer
(
self
,
sender
=
participant
)
del
participant
.
participant
.
participant_item
self
.
participantAboutToBeRemoved
.
emit
(
participant
)
self
.
_pop_participant
(
participant
)
self
.
participantRemoved
.
emit
(
participant
)
...
...
@@ -1513,6 +1511,7 @@ class ConferenceParticipantModel(QAbstractListModel):
notification_center
=
NotificationCenter
()
self
.
beginResetModel
()
for
participant
in
self
.
participants
:
del
participant
.
participant
.
participant_item
notification_center
.
remove_observer
(
self
,
sender
=
participant
)
self
.
participants
=
[]
self
.
endResetModel
()
...
...
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