summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorSergey Borushevsky <sborushevsky@productengine.com>2009-11-24 20:27:56 +0200
committerSergey Borushevsky <sborushevsky@productengine.com>2009-11-24 20:27:56 +0200
commitc227f93b1a6f89847242261f634079d4d6bfbf08 (patch)
tree525f9d3c05986b52948334734b28f6435de2519f /indra/newview
parentb0704256918d4576730ab324e1d67fe8fdd787c0 (diff)
Fixed minor bug EXT-2745 (Contents of Groups field duplicates after IM session has been started)
--HG-- branch : product-engine
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llpanelavatar.cpp30
-rw-r--r--indra/newview/llpanelavatar.h4
2 files changed, 21 insertions, 13 deletions
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 03401d934f..ed1d93db78 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -359,7 +359,7 @@ void LLPanelAvatarProfile::onOpen(const LLSD& key)
{
LLPanelProfileTab::onOpen(key);
- mGroups.erase();
+ mGroups.clear();
//Disable "Add Friend" button for friends.
childSetEnabled("add_friend", !LLAvatarActions::isFriend(getAvatarId()));
@@ -391,7 +391,7 @@ void LLPanelAvatarProfile::resetControls()
void LLPanelAvatarProfile::resetData()
{
- mGroups.erase();
+ mGroups.clear();
childSetValue("2nd_life_pic",LLUUID::null);
childSetValue("real_world_pic",LLUUID::null);
childSetValue("online_status",LLStringUtil::null);
@@ -443,23 +443,29 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g
// Group properties may arrive in two callbacks, we need to save them across
// different calls. We can't do that in textbox as textbox may change the text.
- std::string groups = mGroups;
LLAvatarGroups::group_list_t::const_iterator it = avatar_groups->group_list.begin();
const LLAvatarGroups::group_list_t::const_iterator it_end = avatar_groups->group_list.end();
- if(groups.empty() && it_end != it)
- {
- groups = (*it).group_name;
- ++it;
- }
for(; it_end != it; ++it)
{
LLAvatarGroups::LLGroupData group_data = *it;
- groups += ", ";
- groups += group_data.group_name;
+
+ // Check if there is no duplicates for this group
+ if (std::find(mGroups.begin(), mGroups.end(), group_data.group_name) == mGroups.end())
+ mGroups.push_back(group_data.group_name);
+ }
+
+ // Creating string, containing group list
+ std::string groups = "";
+ for (group_list_t::const_iterator it = mGroups.begin(); it != mGroups.end(); ++it)
+ {
+ if (it != mGroups.begin())
+ groups += ", ";
+
+ groups += *it;
}
- mGroups = groups;
- childSetValue("sl_groups",mGroups);
+
+ childSetValue("sl_groups", groups);
}
void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data)
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index a0caf0c915..8e0965e0b7 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -183,7 +183,9 @@ protected:
private:
- std::string mGroups;
+ typedef std::list<std::string> group_list_t;
+ group_list_t mGroups;
+
LLToggleableMenu* mProfileMenu;
};