diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2020-08-10 20:50:27 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2020-08-10 20:50:27 +0300 |
commit | 43941a3d876b854560b06906665d689c3924aed1 (patch) | |
tree | 4934b6cb0e778c5ef0dedebb3c9b93878d2508fb /indra/newview | |
parent | 8213cc896c74ca08ee231aa557eac302445c933e (diff) |
SL-13669 tests should cover import/export category from llsd
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 6c61c34075..bbed741a33 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -81,11 +81,6 @@ static const char * const LOG_INV("Inventory"); static const char * const LOG_LOCAL("InventoryLocalize"); static const char * const LOG_NOTECARD("copy_inventory_from_notecard"); -static const std::string INV_CAT_ID("cat_id"); -static const std::string INV_PARENT_ID("parent_id"); -static const std::string INV_ASSET_TYPE("type"); -static const std::string INV_PREFERRED_TYPE("pref_type"); -static const std::string INV_NAME("name"); static const std::string INV_OWNER_ID("owner_id"); static const std::string INV_VERSION("version"); @@ -696,12 +691,7 @@ S32 LLViewerInventoryCategory::getViewerDescendentCount() const LLSD LLViewerInventoryCategory::exportLLSD() const { - LLSD cat_data; - cat_data[INV_CAT_ID] = mUUID; - cat_data[INV_PARENT_ID] = mParentUUID; - cat_data[INV_ASSET_TYPE] = LLAssetType::lookup(mType); - cat_data[INV_PREFERRED_TYPE] = LLFolderType::lookup(mPreferredType); - cat_data[INV_NAME] = mName; + LLSD cat_data = LLInventoryCategory::exportLLSD(); cat_data[INV_OWNER_ID] = mOwnerID; cat_data[INV_VERSION] = mVersion; @@ -710,28 +700,7 @@ LLSD LLViewerInventoryCategory::exportLLSD() const bool LLViewerInventoryCategory::importLLSD(const LLSD& cat_data) { - if (cat_data.has(INV_CAT_ID)) - { - setUUID(cat_data[INV_CAT_ID].asUUID()); - } - if (cat_data.has(INV_PARENT_ID)) - { - setParent(cat_data[INV_PARENT_ID].asUUID()); - } - if (cat_data.has(INV_ASSET_TYPE)) - { - setType(LLAssetType::lookup(cat_data[INV_ASSET_TYPE].asString())); - } - if (cat_data.has(INV_PREFERRED_TYPE)) - { - setPreferredType(LLFolderType::lookup(cat_data[INV_PREFERRED_TYPE].asString())); - } - if (cat_data.has(INV_NAME)) - { - mName = cat_data[INV_NAME].asString(); - LLStringUtil::replaceNonstandardASCII(mName, ' '); - LLStringUtil::replaceChar(mName, '|', ' '); - } + LLInventoryCategory::importLLSD(cat_data); if (cat_data.has(INV_OWNER_ID)) { mOwnerID = cat_data[INV_OWNER_ID].asUUID(); |