Changeset 6200 for trunk/qt4-gui/src/core/groupmenu.cpp
- Timestamp:
- 05/25/08 06:25:18 (8 months ago)
- Files:
-
- 1 modified
-
trunk/qt4-gui/src/core/groupmenu.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/qt4-gui/src/core/groupmenu.cpp
r6154 r6200 89 89 delete a; 90 90 91 ContactListModel* list = LicqGui::instance()->contactList(); 92 int groupCount = list->rowCount(QModelIndex()); 91 GroupList* g = gUserManager.LockGroupList(LOCK_R); 92 for (unsigned int i = 0; i < g->size(); ++i) 93 { 94 QString name = QString::fromLocal8Bit((*g)[i]); 93 95 94 for (int i = 0; i < groupCount; ++i) 95 { 96 QModelIndex groupIndex = list->index(i, 0, QModelIndex()); 97 unsigned int groupId = groupIndex.data(ContactListModel::GroupIdRole).toUInt(); 96 a = myUserGroupActions->addAction(name); 97 a->setData(i + 1); 98 98 99 // Don't add system groups or other users group 100 if (groupId == 0 || groupId >= ContactListModel::SystemGroupOffset) 101 continue; 102 103 a = myUserGroupActions->addAction(groupIndex.data(ContactListModel::NameRole).toString()); 104 a->setData(groupId); 99 myGroupsMenu->insertAction(myGroupSeparator, a); 105 100 } 101 gUserManager.UnlockGroupList(); 106 102 107 103 // Add groups to menu … … 139 135 // Model uses group+1 so substract one before sending to daemon 140 136 gUserManager.SwapGroups(myGroupId, myGroupId - 1); 141 142 // Daemon doesn't notify us when groups change so notify model from here143 LicqGui::instance()->contactList()->reloadAll();144 LicqGui::instance()->mainWindow()->updateGroups();145 137 } 146 138 … … 149 141 // Model uses group+1 so substract one before sending to daemon 150 142 gUserManager.SwapGroups(myGroupId, myGroupId + 1); 151 152 // Daemon doesn't notify us when groups change so notify model from here153 LicqGui::instance()->contactList()->reloadAll();154 LicqGui::instance()->mainWindow()->updateGroups();155 143 } 156 144 … … 165 153 166 154 gUserManager.RemoveGroup(myGroupId); 167 168 // Daemon doesn't notify us when groups change so notify model from here169 LicqGui::instance()->contactList()->reloadAll();170 LicqGui::instance()->mainWindow()->updateGroups();171 155 } 172 156
