aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra')
-rw-r--r--linden/indra/newview/llassetuploadresponders.cpp2
-rw-r--r--linden/indra/newview/llpreview.cpp29
-rw-r--r--linden/indra/newview/llpreview.h1
3 files changed, 31 insertions, 1 deletions
diff --git a/linden/indra/newview/llassetuploadresponders.cpp b/linden/indra/newview/llassetuploadresponders.cpp
index be3882e..311ff64 100644
--- a/linden/indra/newview/llassetuploadresponders.cpp
+++ b/linden/indra/newview/llassetuploadresponders.cpp
@@ -440,7 +440,6 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content)
440 { 440 {
441 case LLAssetType::AT_NOTECARD: 441 case LLAssetType::AT_NOTECARD:
442 { 442 {
443
444 // Update the UI with the new asset. 443 // Update the UI with the new asset.
445 LLPreviewNotecard* nc; 444 LLPreviewNotecard* nc;
446 nc = (LLPreviewNotecard*)LLPreview::find(item_id); 445 nc = (LLPreviewNotecard*)LLPreview::find(item_id);
@@ -459,6 +458,7 @@ void LLUpdateTaskInventoryResponder::uploadComplete(const LLSD& content)
459 LLAssetType::AT_NOTECARD); 458 LLAssetType::AT_NOTECARD);
460 } 459 }
461 460
461 nc->setAssetId(content["new_asset"].asUUID());
462 nc->refreshFromInventory(); 462 nc->refreshFromInventory();
463 } 463 }
464 } 464 }
diff --git a/linden/indra/newview/llpreview.cpp b/linden/indra/newview/llpreview.cpp
index 1a6d2ca..055851b 100644
--- a/linden/indra/newview/llpreview.cpp
+++ b/linden/indra/newview/llpreview.cpp
@@ -596,3 +596,32 @@ void LLMultiPreview::setAutoOpenInstance(LLMultiPreview* previewp, const LLUUID&
596 sAutoOpenPreviewHandles[id] = previewp->getHandle(); 596 sAutoOpenPreviewHandles[id] = previewp->getHandle();
597 } 597 }
598} 598}
599
600void LLPreview::setAssetId(const LLUUID& asset_id)
601{
602 const LLViewerInventoryItem* item = getItem();
603 if(NULL == item)
604 {
605 return;
606 }
607
608 if(mObjectUUID.isNull())
609 {
610 // Update avatar inventory asset_id.
611 LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
612 new_item->setAssetUUID(asset_id);
613 gInventory.updateItem(new_item);
614 gInventory.notifyObservers();
615 }
616 else
617 {
618 // Update object inventory asset_id.
619 LLViewerObject* object = gObjectList.findObject(mObjectUUID);
620 if(NULL == object)
621 {
622 llwarns << "LLPreview::setAssetId() called on unrecognized object, UUID : " << mObjectUUID << llendl;
623 return;
624 }
625 object->updateViewerInventoryAsset(item, asset_id);
626 }
627}
diff --git a/linden/indra/newview/llpreview.h b/linden/indra/newview/llpreview.h
index 74daca6..4e159f3 100644
--- a/linden/indra/newview/llpreview.h
+++ b/linden/indra/newview/llpreview.h
@@ -83,6 +83,7 @@ public:
83 void setItemID(const LLUUID& item_id); 83 void setItemID(const LLUUID& item_id);
84 void setObjectID(const LLUUID& object_id); 84 void setObjectID(const LLUUID& object_id);
85 void setSourceID(const LLUUID& source_id); 85 void setSourceID(const LLUUID& source_id);
86 void setAssetId(const LLUUID& asset_id);
86 const LLViewerInventoryItem *getItem() const; // searches if not constructed with it 87 const LLViewerInventoryItem *getItem() const; // searches if not constructed with it
87 88
88 static LLPreview* find(const LLUUID& item_uuid); 89 static LLPreview* find(const LLUUID& item_uuid);