Changeset 6197 for trunk/qt4-gui/src/contactlist
- Timestamp:
- 05/25/08 06:14:27 (6 months ago)
- Location:
- trunk/qt4-gui/src/contactlist
- Files:
-
- 2 modified
-
contactlist.cpp (modified) (4 diffs)
-
contactlist.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/contactlist/contactlist.cpp
r6190 r6197 45 45 for (unsigned long i = 0; i < NUM_GROUPS_SYSTEM_ALL; ++i) 46 46 { 47 mySystemGroups[i] = new ContactGroup(SystemGroupOffset + i,47 mySystemGroups[i] = createGroup(SystemGroupOffset + i, 48 48 LicqStrings::getSystemGroupName(i)); 49 connect(mySystemGroups[i], SIGNAL(dataChanged(ContactGroup*)),50 SLOT(groupDataChanged(ContactGroup*)));51 connect(mySystemGroups[i], SIGNAL(barDataChanged(ContactBar*, int)),52 SLOT(barDataChanged(ContactBar*, int)));53 49 } 54 50 … … 68 64 for (unsigned long i = 0; i < NUM_GROUPS_SYSTEM_ALL; ++i) 69 65 delete mySystemGroups[i]; 66 } 67 68 ContactGroup* ContactListModel::createGroup(unsigned short id, QString name) 69 { 70 ContactGroup* group = new ContactGroup(id, name); 71 connect(group, SIGNAL(dataChanged(ContactGroup*)), 72 SLOT(groupDataChanged(ContactGroup*))); 73 connect(group, SIGNAL(barDataChanged(ContactBar*, int)), 74 SLOT(barDataChanged(ContactBar*, int))); 75 return group; 70 76 } 71 77 … … 202 208 beginInsertRows(QModelIndex(), 0, g->size()); 203 209 204 ContactGroup* newGroup = new ContactGroup(0, tr("Other Users")); 205 connect(newGroup, SIGNAL(dataChanged(ContactGroup*)), 206 SLOT(groupDataChanged(ContactGroup*))); 207 connect(newGroup, SIGNAL(barDataChanged(ContactBar*, int)), 208 SLOT(barDataChanged(ContactBar*, int))); 209 myUserGroups.append(newGroup); 210 ContactGroup* newGroup = createGroup(0, tr("Other Users")); 210 211 211 212 for (unsigned short i = 0; i < g->size(); ++i) 212 213 { 213 newGroup = new ContactGroup(i+1, QString::fromLocal8Bit((*g)[i])); 214 connect(newGroup, SIGNAL(dataChanged(ContactGroup*)), 215 SLOT(groupDataChanged(ContactGroup*))); 216 connect(newGroup, SIGNAL(barDataChanged(ContactBar*, int)), 217 SLOT(barDataChanged(ContactBar*, int))); 214 newGroup = createGroup(i+1, QString::fromLocal8Bit((*g)[i])); 218 215 myUserGroups.append(newGroup); 219 216 } … … 327 324 delete myUsers.takeFirst(); 328 325 326 beginRemoveRows(QModelIndex(), 0, myUserGroups.size()-1); 329 327 while (!myUserGroups.isEmpty()) 330 328 delete myUserGroups.takeFirst(); 329 endRemoveRows(); 331 330 } 332 331 -
trunk/qt4-gui/src/contactlist/contactlist.h
r6190 r6197 386 386 private: 387 387 /** 388 * Create a group object and connect signals for it 389 * 390 * @param id Id for the new group 391 * @param name Name for the new group 392 * @return The created group 393 */ 394 ContactGroup* createGroup(unsigned short id, QString name); 395 396 /** 388 397 * Get the user object that represents an licq contact 389 398 *
