Changeset 506:ea3d99defee6 in qutecom-2.2
Legend:
- Unmodified
- Added
- Removed
-
wengophone/src/presentation/qt/contactlist/QtContactList.cpp
r492 r506 36 36 37 37 #include <model/contactlist/Contact.h> 38 #include <model/contactlist/ContactList.h> 38 39 #include <model/contactlist/ContactGroup.h> 39 40 … … 202 203 203 204 list = _ui->treeWidget->findItems(contactGroupId, Qt::MatchExactly); 204 if (list.isEmpty()) { 205 QTreeWidgetItem * group = new QTreeWidgetItem(_ui->treeWidget); 206 group->setText(0, contactGroupId); 207 _ui->treeWidget->setItemExpanded(group, true); 205 if (list.isEmpty()) 206 { 207 bool group_has_contact = false; 208 std::list<Contact> contacts = _cContactList.getContactList().getContacts(); 209 for (std::list<Contact>::iterator it = contacts.begin();it != contacts.end() ; it++ ) 210 { 211 if ( (*it).getGroupId() == contactGroupId.toStdString()) 212 { 213 group_has_contact = true; 214 break; 215 } 216 } 217 218 if(group_has_contact) 219 { 220 QTreeWidgetItem * group = new QTreeWidgetItem(_ui->treeWidget); 221 group->setText(0, contactGroupId); 222 _ui->treeWidget->setItemExpanded(group, true); 223 } 208 224 } 209 225 }
Note: See TracChangeset
for help on using the changeset viewer.
