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
80bd2578
Commit
80bd2578
authored
May 09, 2010
by
Dan Pascu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplified model reset when loading contacts
parent
4092127d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
contacts.py
blink/contacts.py
+7
-8
No files found.
blink/contacts.py
View file @
80bd2578
...
...
@@ -410,6 +410,10 @@ class ContactModel(QAbstractListModel):
self
.
items
=
[]
self
.
deleted_items
=
[]
self
.
contact_list
=
parent
.
contact_list
if
not
hasattr
(
self
,
'beginResetModel'
):
# emulate beginResetModel/endResetModel for QT < 4.6
self
.
beginResetModel
=
Null
# or use self.modelAboutToBeReset.emit (it'll be emited twice though in that case)
self
.
endResetModel
=
self
.
reset
self
.
save_queue
=
EventQueue
(
self
.
store_contacts
,
name
=
'ContactsSavingThread'
)
self
.
save_queue
.
start
()
...
...
@@ -646,14 +650,9 @@ class ContactModel(QAbstractListModel):
Contact
(
group
,
'VUC Conference'
,
'200901@login.zipdx.com'
,
'icons/200901@login.zipdx.com.png'
)]
contacts
.
sort
(
key
=
attrgetter
(
'name'
))
items
=
[
group
]
+
contacts
if
self
.
items
:
self
.
beginRemoveRows
(
QModelIndex
(),
0
,
len
(
self
.
items
)
-
1
)
del
self
.
items
[:]
self
.
endRemoveRows
()
if
items
:
self
.
beginInsertRows
(
QModelIndex
(),
0
,
len
(
items
)
-
1
)
self
.
items
=
items
self
.
endInsertRows
()
self
.
beginResetModel
()
self
.
items
=
items
self
.
endResetModel
()
for
position
,
item
in
enumerate
(
self
.
items
):
if
type
(
item
)
is
ContactGroup
:
self
.
contact_list
.
openPersistentEditor
(
self
.
index
(
position
))
...
...
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