diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-04-07 21:01:00 +0300 |
---|---|---|
committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2023-04-07 21:02:10 +0300 |
commit | bb4967817e5e0251ebcbae861fcd998f22ce0c0c (patch) | |
tree | 699f5fe4141a43ec49f67b791862bae066de224f | |
parent | 43ff8108f2d056b84ab2a7586951ad363c350f05 (diff) |
SL-18918 Fix folder type when creating folders
Might be better to replace "type" with "type_default" everywere, not just for AIS
-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, |