summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelprofile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelprofile.cpp')
-rw-r--r--indra/newview/llpanelprofile.cpp34
1 files changed, 20 insertions, 14 deletions
diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp
index 24a6875d5a..758ca0b0fa 100644
--- a/indra/newview/llpanelprofile.cpp
+++ b/indra/newview/llpanelprofile.cpp
@@ -106,11 +106,11 @@ LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::stri
{
LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID);
LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t
- httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("post_profile_image_coro", httpPolicy));
- LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
+ httpAdapter = std::make_shared<LLCoreHttpUtil::HttpCoroutineAdapter>("post_profile_image_coro", httpPolicy);
+ LLCore::HttpRequest::ptr_t httpRequest = std::make_shared<LLCore::HttpRequest>();
LLCore::HttpHeaders::ptr_t httpHeaders;
- LLCore::HttpOptions::ptr_t httpOpts(new LLCore::HttpOptions);
+ LLCore::HttpOptions::ptr_t httpOpts = std::make_shared<LLCore::HttpOptions>();
httpOpts->setFollowRedirects(true);
LLSD result = httpAdapter->postAndSuspend(httpRequest, cap_url, first_data, httpOpts, httpHeaders);
@@ -138,9 +138,9 @@ LLUUID post_profile_image(std::string cap_url, const LLSD &first_data, std::stri
}
// Upload the image
- LLCore::HttpRequest::ptr_t uploaderhttpRequest(new LLCore::HttpRequest);
- LLCore::HttpHeaders::ptr_t uploaderhttpHeaders(new LLCore::HttpHeaders);
- LLCore::HttpOptions::ptr_t uploaderhttpOpts(new LLCore::HttpOptions);
+ LLCore::HttpRequest::ptr_t uploaderhttpRequest = std::make_shared<LLCore::HttpRequest>();
+ LLCore::HttpHeaders::ptr_t uploaderhttpHeaders = std::make_shared<LLCore::HttpHeaders>();
+ LLCore::HttpOptions::ptr_t uploaderhttpOpts = std::make_shared<LLCore::HttpOptions>();
S64 length;
{
@@ -693,6 +693,7 @@ LLPanelProfileSecondLife::LLPanelProfileSecondLife()
, mWaitingForImageUpload(false)
, mAllowPublish(false)
, mHideAge(false)
+ , mAllowEdit(true)
{
}
@@ -709,6 +710,10 @@ LLPanelProfileSecondLife::~LLPanelProfileSecondLife()
{
mAvatarNameCacheConnection.disconnect();
}
+ if (mMenuNameCacheConnection.connected())
+ {
+ mMenuNameCacheConnection.disconnect();
+ }
}
bool LLPanelProfileSecondLife::postBuild()
@@ -757,14 +762,15 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key)
LLUUID avatar_id = getAvatarId();
bool own_profile = getSelfProfile();
+ bool allow_edit = own_profile && mAllowEdit;
mGroupList->setShowNone(!own_profile);
- childSetVisible("notes_panel", !own_profile);
- childSetVisible("settings_panel", own_profile);
- childSetVisible("about_buttons_panel", own_profile);
+ childSetVisible("notes_panel", !allow_edit);
+ childSetVisible("settings_panel", allow_edit);
+ childSetVisible("about_buttons_panel", allow_edit);
- if (own_profile)
+ if (allow_edit)
{
// Group list control cannot toggle ForAgent loading
// Less than ideal, but viewing own profile via search is edge case
@@ -789,7 +795,7 @@ void LLPanelProfileSecondLife::onOpen(const LLSD& key)
mAgentActionMenuButton->setMenu("menu_profile_other.xml", LLMenuButton::MP_BOTTOM_RIGHT);
}
- mDescriptionEdit->setParseHTML(!own_profile);
+ mDescriptionEdit->setParseHTML(!allow_edit);
if (!own_profile)
{
@@ -1022,7 +1028,7 @@ void LLPanelProfileSecondLife::fillCommonData(const LLAvatarData* avatar_data)
if (getSelfProfile())
{
mAllowPublish = avatar_data->flags & AVATAR_ALLOW_PUBLISH;
- mShowInSearchCombo->setValue(mAllowPublish);
+ mShowInSearchCombo->setValue(mAllowPublish ? LLSD::Integer(1) : LLSD::Integer(0));
}
}
@@ -1280,7 +1286,7 @@ void LLPanelProfileSecondLife::setLoaded()
{
mHideAgeCombo->setEnabled(true);
}
- mDescriptionEdit->setEnabled(true);
+ mDescriptionEdit->setEnabled(mAllowEdit);
}
}
@@ -1461,7 +1467,7 @@ void LLPanelProfileSecondLife::onCommitMenu(const LLSD& userdata)
}
else if (item_name == "edit_display_name")
{
- LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCacheSetName, this, _1, _2));
+ mMenuNameCacheConnection = LLAvatarNameCache::get(getAvatarId(), boost::bind(&LLPanelProfileSecondLife::onAvatarNameCacheSetName, this, _1, _2));
LLFirstUse::setDisplayName(false);
}
else if (item_name == "edit_partner")