diff options
-rw-r--r-- | indra/newview/llassetuploadresponders.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llpreview.cpp | 28 | ||||
-rw-r--r-- | indra/newview/llpreview.h | 1 |
3 files changed, 30 insertions, 1 deletions
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 827ae5855b..cd3963050f 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -539,7 +539,7 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content) gVFS->removeFile(content["new_asset"].asUUID(), LLAssetType::AT_NOTECARD); } - + nc->setAssetId(content["new_asset"].asUUID()); nc->refreshFromInventory(); } break; diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index ab253e012d..b06e70c00a 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -492,3 +492,31 @@ void LLMultiPreview::tabOpen(LLFloater* opened_floater, bool from_click) } } + +void LLPreview::setAssetId(const LLUUID& asset_id) +{ + const LLViewerInventoryItem* item = dynamic_cast<const LLViewerInventoryItem*>(getItem()); + if(NULL == item) + { + return; + } + + if(mObjectUUID.isNull()) + { + // Update avatar inventory asset_id. + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); + new_item->setAssetUUID(asset_id); + gInventory.updateItem(new_item); + gInventory.notifyObservers(); + } + else + { + // Update object inventory asset_id. + LLViewerObject* object = gObjectList.findObject(mObjectUUID); + if(NULL == object) + { + return; + } + object->updateViewerInventoryAsset(item, asset_id); + } +} diff --git a/indra/newview/llpreview.h b/indra/newview/llpreview.h index c5f2bfcf47..506c135ca6 100644 --- a/indra/newview/llpreview.h +++ b/indra/newview/llpreview.h @@ -77,6 +77,7 @@ public: void setObjectID(const LLUUID& object_id); void setItem( LLInventoryItem* item ); + void setAssetId(const LLUUID& asset_id); const LLInventoryItem* getItem() const; // searches if not constructed with it static void hide(const LLUUID& item_uuid, BOOL no_saving = FALSE ); |