aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llpanelgrouproles.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:29 -0500
committerJacek Antonelli2008-08-15 23:45:29 -0500
commit7bdb4845afdd157f95281293803567090e3f992a (patch)
treefbcada1c227d7407f9f37ccba360bfe6326d9c5e /linden/indra/newview/llpanelgrouproles.cpp
parentSecond Life viewer sources 1.19.0.0 (diff)
downloadmeta-impy-7bdb4845afdd157f95281293803567090e3f992a.zip
meta-impy-7bdb4845afdd157f95281293803567090e3f992a.tar.gz
meta-impy-7bdb4845afdd157f95281293803567090e3f992a.tar.bz2
meta-impy-7bdb4845afdd157f95281293803567090e3f992a.tar.xz
Second Life viewer sources 1.19.0.2
Diffstat (limited to 'linden/indra/newview/llpanelgrouproles.cpp')
-rw-r--r--linden/indra/newview/llpanelgrouproles.cpp109
1 files changed, 41 insertions, 68 deletions
diff --git a/linden/indra/newview/llpanelgrouproles.cpp b/linden/indra/newview/llpanelgrouproles.cpp
index 3401bee..5a2d9db 100644
--- a/linden/indra/newview/llpanelgrouproles.cpp
+++ b/linden/indra/newview/llpanelgrouproles.cpp
@@ -70,7 +70,7 @@ bool agentCanAddToRole(const LLUUID& group_id,
70 } 70 }
71 71
72 //make sure the agent is in the group 72 //make sure the agent is in the group
73 LLGroupMgrGroupData::member_iter mi = gdatap->mMembers.find(gAgent.getID()); 73 LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find(gAgent.getID());
74 if (mi == gdatap->mMembers.end()) 74 if (mi == gdatap->mMembers.end())
75 { 75 {
76 return false; 76 return false;
@@ -1010,8 +1010,8 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
1010 // Build the assigned roles list. 1010 // Build the assigned roles list.
1011 ////////////////////////////////// 1011 //////////////////////////////////
1012 // Add each role to the assigned roles list. 1012 // Add each role to the assigned roles list.
1013 LLGroupMgrGroupData::role_iter iter = gdatap->mRoles.begin(); 1013 LLGroupMgrGroupData::role_list_t::iterator iter = gdatap->mRoles.begin();
1014 LLGroupMgrGroupData::role_iter end = gdatap->mRoles.end(); 1014 LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end();
1015 1015
1016 BOOL can_eject_members = gAgent.hasPowerInGroup(mGroupID, 1016 BOOL can_eject_members = gAgent.hasPowerInGroup(mGroupID,
1017 GP_MEMBER_EJECT); 1017 GP_MEMBER_EJECT);
@@ -1052,7 +1052,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
1052 if ((*member_iter) == gAgent.getID()) continue; 1052 if ((*member_iter) == gAgent.getID()) continue;
1053 1053
1054 // Look up the member data. 1054 // Look up the member data.
1055 LLGroupMgrGroupData::member_iter mi = 1055 LLGroupMgrGroupData::member_list_t::iterator mi =
1056 gdatap->mMembers.find((*member_iter)); 1056 gdatap->mMembers.find((*member_iter));
1057 if (mi == gdatap->mMembers.end()) continue; 1057 if (mi == gdatap->mMembers.end()) continue;
1058 LLGroupMemberData* member_data = (*mi).second; 1058 LLGroupMemberData* member_data = (*mi).second;
@@ -1146,7 +1146,7 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
1146 if (!can_eject_members && !member_is_owner) 1146 if (!can_eject_members && !member_is_owner)
1147 { 1147 {
1148 // Maybe we can eject them because we are an owner... 1148 // Maybe we can eject them because we are an owner...
1149 LLGroupMgrGroupData::member_iter mi = gdatap->mMembers.find(gAgent.getID()); 1149 LLGroupMgrGroupData::member_list_t::iterator mi = gdatap->mMembers.find(gAgent.getID());
1150 if (mi != gdatap->mMembers.end()) 1150 if (mi != gdatap->mMembers.end())
1151 { 1151 {
1152 LLGroupMemberData* member_data = (*mi).second; 1152 LLGroupMemberData* member_data = (*mi).second;
@@ -1230,41 +1230,29 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id,
1230 LLUUID member_id; 1230 LLUUID member_id;
1231 1231
1232 1232
1233 member_role_change_iter member_end = mMemberRoleChangeData.end();
1234 member_role_change_iter member;
1235 role_change_data_map_t *role_change_datap;
1236 role_change_data_map_t::iterator role_end;
1237 role_change_data_map_t::iterator role;
1238
1239 std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected(); 1233 std::vector<LLScrollListItem*> selection = mMembersList->getAllSelected();
1240 if (selection.empty()) return; 1234 if (selection.empty())
1241 1235 {
1242 std::vector<LLScrollListItem*>::iterator itor; 1236 return;
1243 for (itor = selection.begin() ; 1237 }
1238
1239 for (std::vector<LLScrollListItem*>::iterator itor = selection.begin() ;
1244 itor != selection.end(); ++itor) 1240 itor != selection.end(); ++itor)
1245 { 1241 {
1246 member_id = (*itor)->getUUID(); 1242 member_id = (*itor)->getUUID();
1247 1243
1248 //see if we requested a change for this member before 1244 //see if we requested a change for this member before
1249 member = mMemberRoleChangeData.find(member_id); 1245 if ( mMemberRoleChangeData.find(member_id) == mMemberRoleChangeData.end() )
1250 if ( member != member_end )
1251 { 1246 {
1252 //this member had previously had their role data changed 1247 mMemberRoleChangeData[member_id] = new role_change_data_map_t;
1253 //so grab it
1254 role_change_datap = (*member).second;
1255 }
1256 else
1257 {
1258 role_change_datap = new role_change_data_map_t;
1259 mMemberRoleChangeData[member_id] = role_change_datap;
1260 } 1248 }
1249 role_change_data_map_t* role_change_datap = mMemberRoleChangeData[member_id];
1261 1250
1262 //now check to see if the selected group member 1251 //now check to see if the selected group member
1263 //had changed his association with the selected role before 1252 //had changed his association with the selected role before
1264 role_end = role_change_datap->end();
1265 role = role_change_datap->find(role_id);
1266 1253
1267 if ( role != role_end ) 1254 role_change_data_map_t::iterator role = role_change_datap->find(role_id);
1255 if ( role != role_change_datap->end() )
1268 { 1256 {
1269 //see if the new change type cancels out the previous change 1257 //see if the new change type cancels out the previous change
1270 if (role->second != type) 1258 if (role->second != type)
@@ -1454,15 +1442,11 @@ void LLPanelGroupMembersSubTab::applyMemberChanges()
1454 1442
1455 //we need to add all of the changed roles data 1443 //we need to add all of the changed roles data
1456 //for each member whose role changed 1444 //for each member whose role changed
1457 member_role_change_iter member_end = mMemberRoleChangeData.end(); 1445 for (member_role_changes_map_t::iterator member = mMemberRoleChangeData.begin();
1458 member_role_change_iter member = mMemberRoleChangeData.begin(); 1446 member != mMemberRoleChangeData.end(); ++member)
1459
1460 for (; member != member_end; member++)
1461 { 1447 {
1462 role_change_data_map_t::iterator role_end = member->second->end(); 1448 for (role_change_data_map_t::iterator role = member->second->begin();
1463 role_change_data_map_t::iterator role = member->second->begin(); 1449 role != member->second->end(); ++role)
1464
1465 for (; role != role_end; role++)
1466 { 1450 {
1467 gdatap->changeRoleMember(role->first, //role_id 1451 gdatap->changeRoleMember(role->first, //role_id
1468 member->first, //member_id 1452 member->first, //member_id
@@ -1515,11 +1499,6 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag
1515 //if we are removing a role, we store that role id away 1499 //if we are removing a role, we store that role id away
1516 //and then we have to build the powers up bases on the roles the agent 1500 //and then we have to build the powers up bases on the roles the agent
1517 //is in 1501 //is in
1518 member_role_change_iter member_end = mMemberRoleChangeData.end();
1519 member_role_change_iter member;
1520 role_change_data_map_t *role_change_datap = NULL;
1521 role_change_data_map_t::iterator role_end;
1522 role_change_data_map_t::iterator role;
1523 1502
1524 LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID); 1503 LLGroupMgrGroupData* gdatap = gGroupMgr->getGroupData(mGroupID);
1525 if (!gdatap) 1504 if (!gdatap)
@@ -1536,8 +1515,9 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag
1536 } 1515 }
1537 1516
1538 //see if there are unsaved role changes for this agent 1517 //see if there are unsaved role changes for this agent
1539 member = mMemberRoleChangeData.find(agent_id); 1518 role_change_data_map_t* role_change_datap = NULL;
1540 if ( member != member_end ) 1519 member_role_changes_map_t::iterator member = mMemberRoleChangeData.find(agent_id);
1520 if ( member != mMemberRoleChangeData.end() )
1541 { 1521 {
1542 //this member has unsaved role changes 1522 //this member has unsaved role changes
1543 //so grab them 1523 //so grab them
@@ -1550,13 +1530,13 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag
1550 { 1530 {
1551 std::vector<LLUUID> roles_to_be_removed; 1531 std::vector<LLUUID> roles_to_be_removed;
1552 1532
1553 role_end = role_change_datap->end(); 1533 for (role_change_data_map_t::iterator role = role_change_datap->begin();
1554 role = role_change_datap->begin(); 1534 role != role_change_datap->end(); ++ role)
1555
1556 for (; role != role_end; role++)
1557 { 1535 {
1558 if ( role->second == RMC_ADD ) 1536 if ( role->second == RMC_ADD )
1537 {
1559 new_powers |= gdatap->getRolePowers(role->first); 1538 new_powers |= gdatap->getRolePowers(role->first);
1539 }
1560 else 1540 else
1561 { 1541 {
1562 roles_to_be_removed.push_back(role->first); 1542 roles_to_be_removed.push_back(role->first);
@@ -1565,12 +1545,8 @@ U64 LLPanelGroupMembersSubTab::getAgentPowersBasedOnRoleChanges(const LLUUID& ag
1565 1545
1566 //loop over the member's current roles, summing up 1546 //loop over the member's current roles, summing up
1567 //the powers (not including the role we are removing) 1547 //the powers (not including the role we are removing)
1568 std::map<LLUUID,LLGroupRoleData*>::iterator current_role = 1548 for (LLGroupMemberData::role_list_t::iterator current_role = member_data->roleBegin();
1569 member_data->roleBegin(); 1549 current_role != member_data->roleEnd(); ++current_role)
1570 std::map<LLUUID,LLGroupRoleData*>::iterator end_role =
1571 member_data->roleEnd();
1572
1573 for (; current_role != end_role; current_role++)
1574 { 1550 {
1575 bool role_in_remove_list = 1551 bool role_in_remove_list =
1576 (std::find(roles_to_be_removed.begin(), 1552 (std::find(roles_to_be_removed.begin(),
@@ -1603,13 +1579,10 @@ bool LLPanelGroupMembersSubTab::getRoleChangeType(const LLUUID& member_id,
1603 const LLUUID& role_id, 1579 const LLUUID& role_id,
1604 LLRoleMemberChangeType& type) 1580 LLRoleMemberChangeType& type)
1605{ 1581{
1606 member_role_change_iter member_changes_iter; 1582 member_role_changes_map_t::iterator member_changes_iter = mMemberRoleChangeData.find(member_id);
1607 role_change_data_map_t::iterator role_changes_iter;
1608
1609 member_changes_iter = mMemberRoleChangeData.find(member_id);
1610 if ( member_changes_iter != mMemberRoleChangeData.end() ) 1583 if ( member_changes_iter != mMemberRoleChangeData.end() )
1611 { 1584 {
1612 role_changes_iter = member_changes_iter->second->find(role_id); 1585 role_change_data_map_t::iterator role_changes_iter = member_changes_iter->second->find(role_id);
1613 if ( role_changes_iter != member_changes_iter->second->end() ) 1586 if ( role_changes_iter != member_changes_iter->second->end() )
1614 { 1587 {
1615 type = role_changes_iter->second; 1588 type = role_changes_iter->second;
@@ -1707,7 +1680,7 @@ void LLPanelGroupMembersSubTab::updateMembers()
1707 return; 1680 return;
1708 } 1681 }
1709 1682
1710 LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end(); 1683 LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end();
1711 1684
1712 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ 1685 char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
1713 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ 1686 char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/
@@ -1997,8 +1970,8 @@ void LLPanelGroupRolesSubTab::update(LLGroupChange gc)
1997 1970
1998 LLScrollListItem* item = NULL; 1971 LLScrollListItem* item = NULL;
1999 1972
2000 LLGroupMgrGroupData::role_iter rit = gdatap->mRoles.begin(); 1973 LLGroupMgrGroupData::role_list_t::iterator rit = gdatap->mRoles.begin();
2001 LLGroupMgrGroupData::role_iter end = gdatap->mRoles.end(); 1974 LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end();
2002 1975
2003 for ( ; rit != end; ++rit) 1976 for ( ; rit != end; ++rit)
2004 { 1977 {
@@ -2181,8 +2154,8 @@ void LLPanelGroupRolesSubTab::buildMembersList()
2181 if (item->getUUID().isNull()) 2154 if (item->getUUID().isNull())
2182 { 2155 {
2183 // Special cased 'Everyone' role 2156 // Special cased 'Everyone' role
2184 LLGroupMgrGroupData::member_iter mit = gdatap->mMembers.begin(); 2157 LLGroupMgrGroupData::member_list_t::iterator mit = gdatap->mMembers.begin();
2185 LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end(); 2158 LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end();
2186 for ( ; mit != end; ++mit) 2159 for ( ; mit != end; ++mit)
2187 { 2160 {
2188 mAssignedMembersList->addNameItem((*mit).first); 2161 mAssignedMembersList->addNameItem((*mit).first);
@@ -2190,7 +2163,7 @@ void LLPanelGroupRolesSubTab::buildMembersList()
2190 } 2163 }
2191 else 2164 else
2192 { 2165 {
2193 LLGroupMgrGroupData::role_iter rit = gdatap->mRoles.find(item->getUUID()); 2166 LLGroupMgrGroupData::role_list_t::iterator rit = gdatap->mRoles.find(item->getUUID());
2194 if (rit != gdatap->mRoles.end()) 2167 if (rit != gdatap->mRoles.end())
2195 { 2168 {
2196 LLGroupRoleData* rdatap = (*rit).second; 2169 LLGroupRoleData* rdatap = (*rit).second;
@@ -2643,8 +2616,8 @@ void LLPanelGroupActionsSubTab::handleActionSelect()
2643 2616
2644 if (gdatap->isMemberDataComplete()) 2617 if (gdatap->isMemberDataComplete())
2645 { 2618 {
2646 LLGroupMgrGroupData::member_iter it = gdatap->mMembers.begin(); 2619 LLGroupMgrGroupData::member_list_t::iterator it = gdatap->mMembers.begin();
2647 LLGroupMgrGroupData::member_iter end = gdatap->mMembers.end(); 2620 LLGroupMgrGroupData::member_list_t::iterator end = gdatap->mMembers.end();
2648 LLGroupMemberData* gmd; 2621 LLGroupMemberData* gmd;
2649 2622
2650 for ( ; it != end; ++it) 2623 for ( ; it != end; ++it)
@@ -2664,8 +2637,8 @@ void LLPanelGroupActionsSubTab::handleActionSelect()
2664 2637
2665 if (gdatap->isRoleDataComplete()) 2638 if (gdatap->isRoleDataComplete())
2666 { 2639 {
2667 LLGroupMgrGroupData::role_iter it = gdatap->mRoles.begin(); 2640 LLGroupMgrGroupData::role_list_t::iterator it = gdatap->mRoles.begin();
2668 LLGroupMgrGroupData::role_iter end = gdatap->mRoles.end(); 2641 LLGroupMgrGroupData::role_list_t::iterator end = gdatap->mRoles.end();
2669 LLGroupRoleData* rmd; 2642 LLGroupRoleData* rmd;
2670 2643
2671 for ( ; it != end; ++it) 2644 for ( ; it != end; ++it)