summaryrefslogtreecommitdiff
path: root/indra/newview/llpaneleditwearable.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2010-07-15 13:56:46 -0400
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2010-07-15 13:56:46 -0400
commitd5655c9bbfc2b498334e055da882055a8d99fff0 (patch)
tree00871889eac2ba87db28261bbf5288e190475c76 /indra/newview/llpaneleditwearable.cpp
parentc80da2248d17bf9355fccd203b51548f983bd8ab (diff)
EXT-8283 FIX - allow saveWearable to change name of wearable, split off logic for saveAs case. Some remaining UI issues will be filed separately. Reviewed by Nyx
Diffstat (limited to 'indra/newview/llpaneleditwearable.cpp')
-rw-r--r--indra/newview/llpaneleditwearable.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp
index 14f05bdb17..f7e8a7b1a7 100644
--- a/indra/newview/llpaneleditwearable.cpp
+++ b/indra/newview/llpaneleditwearable.cpp
@@ -839,7 +839,7 @@ void LLPanelEditWearable::saveAsCallback(const LLSD& notification, const LLSD& r
if( !wearable_name.empty() )
{
mNameEditor->setText(wearable_name);
- saveChanges();
+ saveChanges(true);
}
}
}
@@ -971,7 +971,7 @@ void LLPanelEditWearable::updatePanelPickerControls(LLWearableType::EType type)
}
}
-void LLPanelEditWearable::saveChanges()
+void LLPanelEditWearable::saveChanges(bool force_save_as)
{
if (!mWearablePtr || !isDirty())
{
@@ -980,16 +980,18 @@ void LLPanelEditWearable::saveChanges()
}
U32 index = gAgentWearables.getWearableIndex(mWearablePtr);
-
- if (mWearablePtr->getName().compare(mNameEditor->getText()) != 0)
+
+ std::string new_name = mNameEditor->getText();
+ if (force_save_as)
{
// the name of the wearable has changed, re-save wearable with new name
LLAppearanceMgr::instance().removeCOFItemLinks(mWearablePtr->getItemID(),false);
- gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, mNameEditor->getText(), FALSE);
+ gAgentWearables.saveWearableAs(mWearablePtr->getType(), index, new_name, FALSE);
+ mNameEditor->setText(mWearablePtr->getName());
}
else
{
- gAgentWearables.saveWearable(mWearablePtr->getType(), index);
+ gAgentWearables.saveWearable(mWearablePtr->getType(), index, TRUE, new_name);
}
}