MAINT-6495 Problem with saving notecard embedded in object

meow-7.2.2
Mnikolenko Productengine 2016-06-16 13:56:12 +03:00
parent a199cd76a1
commit d4f5b71434
2 changed files with 19 additions and 1 deletions

View File

@ -437,6 +437,23 @@ void LLPreviewNotecard::finishInventoryUpload(LLUUID itemId, LLUUID newAssetId,
}
}
void LLPreviewNotecard::finishTaskUpload(LLUUID itemId, LLUUID newAssetId, LLUUID taskId)
{
LLSD floater_key;
floater_key["taskid"] = taskId;
floater_key["itemid"] = itemId;
LLPreviewNotecard* nc = LLFloaterReg::findTypedInstance<LLPreviewNotecard>("preview_notecard", floater_key);
if (nc)
{
if (nc->hasEmbeddedInventory())
{
gVFS->removeFile(newAssetId, LLAssetType::AT_NOTECARD);
}
nc->setAssetId(newAssetId);
nc->refreshFromInventory();
}
}
bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
{
@ -485,7 +502,7 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
else if (!mObjectUUID.isNull() && !task_url.empty())
{
uploadInfo = LLResourceUploadInfo::ptr_t(new LLBufferedAssetUploadInfo(mObjectUUID, mItemUUID, LLAssetType::AT_NOTECARD, buffer,
boost::bind(&LLPreviewNotecard::finishInventoryUpload, _1, _3, LLUUID::null)));
boost::bind(&LLPreviewNotecard::finishTaskUpload, _1, _3, mObjectUUID)));
url = task_url;
}

View File

@ -96,6 +96,7 @@ protected:
bool handleConfirmDeleteDialog(const LLSD& notification, const LLSD& response);
static void finishInventoryUpload(LLUUID itemId, LLUUID newAssetId, LLUUID newItemId);
static void finishTaskUpload(LLUUID itemId, LLUUID newAssetId, LLUUID taskId);
protected:
LLViewerTextEditor* mEditor;