Changeset 6189
- Timestamp:
- 05/10/08 23:03:16 (4 months ago)
- Location:
- trunk/qt4-gui/src/contactlist
- Files:
-
- 2 modified
-
contactlist.cpp (modified) (6 diffs)
-
contactlist.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/contactlist/contactlist.cpp
r6153 r6189 39 39 40 40 ContactListModel::ContactListModel(QObject* parent) 41 : QAbstractItemModel(parent) 41 : QAbstractItemModel(parent), 42 myBlockUpdates(false) 42 43 { 43 44 // Create the system groups … … 157 158 void ContactListModel::slot_userDataChanged(const ContactUserData* user) 158 159 { 160 if (myBlockUpdates) 161 return; 162 159 163 // Emit signal that the user has changed in all groups 160 164 foreach (ContactUser* u, user->groupList()) … … 167 171 void ContactListModel::groupDataChanged(ContactGroup* group) 168 172 { 173 if (myBlockUpdates) 174 return; 175 169 176 int groupRow = (group->groupId() < SystemGroupOffset 170 177 ? myUserGroups.indexOf(group) … … 176 183 void ContactListModel::slot_barDataChanged(ContactBar* bar, int row) 177 184 { 185 if (myBlockUpdates) 186 return; 187 178 188 emit dataChanged(createIndex(row, 0, bar), createIndex(row, myColumnCount - 1, bar)); 179 189 } … … 181 191 void ContactListModel::reloadAll() 182 192 { 193 // Don't send out signals while reloading, the reset at the end will be enough 194 myBlockUpdates = true; 195 183 196 // Clear the list of all old groups and users 184 197 clear(); … … 217 230 218 231 // Tell views that we have done major changes 232 myBlockUpdates = false; 219 233 reset(); 220 234 } -
trunk/qt4-gui/src/contactlist/contactlist.h
r6153 r6189 408 408 QList<ContactUserData*> myUsers; 409 409 int myColumnCount; 410 bool myBlockUpdates; 410 411 }; 411 412
