| 44 | | mySortKey = QString("9999999999"); |
| 45 | | } |
| 46 | | |
| | 41 | mySortKey = 65535; |
| | 42 | |
| | 43 | update(); |
| | 44 | |
| | 45 | for (int i = 0; i < 3; ++i) |
| | 46 | myBars[i] = new ContactBar(static_cast<ContactListModel::SubGroupType>(i), this); |
| | 47 | } |
| | 48 | |
| | 49 | ContactGroup::ContactGroup(const LicqGroup* group) |
| | 50 | : ContactItem(ContactListModel::GroupItem), |
| | 51 | myGroupId(group->id()), |
| | 52 | myName(group->name().c_str()), |
| | 53 | mySortKey(group->sortIndex()), |
| | 54 | myEvents(0), |
| | 55 | myVisibleContacts(0) |
| | 56 | { |
| 63 | | GroupList* g = gUserManager.LockGroupList(LOCK_R); |
| 64 | | myName = QString::fromLocal8Bit((*g)[myGroupId-1]); |
| 65 | | gUserManager.UnlockGroupList(); |
| 66 | | |
| 67 | | emit dataChanged(this); |
| | 73 | // System groups and "Other users" aren't present in daemon group list |
| | 74 | if (myGroupId == 0 || myGroupId >= ContactListModel::SystemGroupOffset) |
| | 75 | return; |
| | 76 | |
| | 77 | LicqGroup* g = gUserManager.FetchGroup(myGroupId, LOCK_R); |
| | 78 | if (g == NULL) |
| | 79 | return; |
| | 80 | |
| | 81 | myName = QString::fromLocal8Bit(g->name().c_str()); |
| | 82 | mySortKey = g->sortIndex(); |
| | 83 | gUserManager.DropGroup(g); |
| | 84 | |
| | 85 | emit dataChanged(this); |
| | 86 | } |
| | 87 | |
| | 88 | void ContactGroup::updateSortKey() |
| | 89 | { |
| | 90 | // System groups and "Other users" aren't present in daemon group list |
| | 91 | if (myGroupId == 0 || myGroupId >= ContactListModel::SystemGroupOffset) |
| | 92 | return; |
| | 93 | |
| | 94 | LicqGroup* g = gUserManager.FetchGroup(myGroupId, LOCK_R); |
| | 95 | if (g == NULL) |
| | 96 | return; |
| | 97 | |
| | 98 | mySortKey = g->sortIndex(); |
| | 99 | gUserManager.DropGroup(g); |