diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-07-19 10:18:57 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-07-19 10:18:57 -0400 |
commit | 5b8c1851f2b565fddaab28e23add62f621f15082 (patch) | |
tree | d8525d0f5dd985efb86dcb50e752e19d59a7fb2d /indra/newview/llagentwearables.cpp | |
parent | 94fde578cd845b1a648e66ecf184e7a24beaad6d (diff) | |
parent | 3bb5d368a21e2645222f0f5fa57b0a0abb236084 (diff) |
automated merge
Diffstat (limited to 'indra/newview/llagentwearables.cpp')
-rw-r--r-- | indra/newview/llagentwearables.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index efa5eca217..6ee5a8b279 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -384,7 +384,8 @@ void LLAgentWearables::sendAgentWearablesUpdate() gAgent.sendReliableMessage(); } -void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update) +void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 index, BOOL send_update, + const std::string new_name) { LLWearable* old_wearable = getWearable(type, index); if (old_wearable && (old_wearable->isDirty() || old_wearable->isOldVersion())) @@ -402,6 +403,14 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 LLInventoryItem* item = gInventory.getItem(old_item_id); if (item) { + std::string item_name = item->getName(); + bool name_changed = false; + if (!new_name.empty() && (new_name != item->getName())) + { + llinfos << "saveWearable changing name from " << item->getName() << " to " << new_name << llendl; + item_name = new_name; + name_changed = true; + } // Update existing inventory item LLPointer<LLViewerInventoryItem> template_item = new LLViewerInventoryItem(item->getUUID(), @@ -410,7 +419,7 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 new_wearable->getAssetID(), new_wearable->getAssetType(), item->getInventoryType(), - item->getName(), + item_name, item->getDescription(), item->getSaleInfo(), item->getFlags(), @@ -418,6 +427,10 @@ void LLAgentWearables::saveWearable(const LLWearableType::EType type, const U32 template_item->setTransactionID(new_wearable->getTransactionID()); template_item->updateServer(FALSE); gInventory.updateItem(template_item); + if (name_changed) + { + gInventory.notifyObservers(); + } } else { |