Changeset 6200 for trunk/qt4-gui/src/core
- Timestamp:
- 05/25/08 06:25:18 (6 months ago)
- Location:
- trunk/qt4-gui/src/core
- Files:
-
- 3 modified
-
groupmenu.cpp (modified) (4 diffs)
-
licqgui.cpp (modified) (2 diffs)
-
mainwin.cpp (modified) (1 diff)
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 -
trunk/qt4-gui/src/core/licqgui.cpp
r6190 r6200 1389 1389 switch (sig->SubSignal()) 1390 1390 { 1391 case LIST_ALL:1392 // Handled by ContactListModel1393 break;1394 1395 1391 case LIST_ADD: 1396 1392 { … … 1459 1455 } 1460 1456 1457 case LIST_ALL: 1458 case LIST_GROUP_ADDED: 1459 case LIST_GROUP_REMOVED: 1460 case LIST_GROUP_CHANGED: 1461 myMainWindow->updateGroups(); 1462 myUserMenu->updateGroups(); 1463 myGroupMenu->updateGroups(); 1464 break; 1461 1465 } 1462 1466 } -
trunk/qt4-gui/src/core/mainwin.cpp
r6188 r6200 765 765 if (!initial) 766 766 { 767 // Daemon does not send an update when groups change so tell contactList it768 // needs to update769 LicqGui::instance()->contactList()->reloadAll();770 771 767 // update group list in user and system menus 772 LicqGui::instance()->userMenu()->updateGroups();773 768 mySystemMenu->updateGroups(); 774 769 }
