diff options
-rw-r--r-- | indra/llinventory/llinventory.cpp | 25 | ||||
-rw-r--r-- | indra/llinventory/llinventory.h | 1 | ||||
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 2 |
3 files changed, 23 insertions, 5 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index c6049f3ec4..ef86d2d89b 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -1098,11 +1098,28 @@ void LLInventoryCategory::setPreferredType(LLFolderType::EType type) LLSD LLInventoryCategory::asLLSD() const { LLSD sd = LLSD(); - sd["item_id"] = mUUID; - sd["parent_id"] = mParentUUID; + sd[INV_ITEM_ID_LABEL] = mUUID; + sd[INV_PARENT_ID_LABEL] = mParentUUID; S8 type = static_cast<S8>(mPreferredType); - sd["type"] = type; - sd["name"] = mName; + sd[INV_ASSET_TYPE_LABEL] = type; + sd[INV_NAME_LABEL] = mName; + + if (mThumbnailUUID.notNull()) + { + sd[INV_THUMBNAIL_LABEL] = LLSD().with(INV_ASSET_ID_LABEL, mThumbnailUUID); + } + + return sd; +} + +LLSD LLInventoryCategory::asAISLLSD() const +{ + LLSD sd = LLSD(); + sd[INV_FOLDER_ID_LABEL_WS] = mUUID; + sd[INV_PARENT_ID_LABEL] = mParentUUID; + S8 type = static_cast<S8>(mPreferredType); + sd[INV_ASSET_TYPE_LABEL_WS] = type; + sd[INV_NAME_LABEL] = mName; if (mThumbnailUUID.notNull()) { diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index dfe8b7659b..516cfc6a24 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -253,6 +253,7 @@ public: LLFolderType::EType getPreferredType() const; void setPreferredType(LLFolderType::EType type); LLSD asLLSD() const; + LLSD asAISLLSD() const; bool fromLLSD(const LLSD& sd); //-------------------------------------------------------------------- diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 80f16a854b..4bca2ce650 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1010,7 +1010,7 @@ void LLInventoryModel::createNewCategory(const LLUUID& parent_id, new_inventory["categories"] = LLSD::emptyArray(); LLViewerInventoryCategory cat(LLUUID::null, parent_id, preferred_type, name, gAgent.getID()); cat.setThumbnailUUID(thumbnail_id); - LLSD cat_sd = cat.asLLSD(); + LLSD cat_sd = cat.asAISLLSD(); new_inventory["categories"].append(cat_sd); AISAPI::CreateInventory( parent_id, |