diff options
| author | andreykproductengine <akleshchev@productengine.com> | 2017-01-17 20:11:00 +0200 |
|---|---|---|
| committer | andreykproductengine <akleshchev@productengine.com> | 2017-01-17 20:11:00 +0200 |
| commit | b94aa751c93b2c9bf9a9567946fe388a7c475d77 (patch) | |
| tree | 753be8a9339d02f568fdf0506aa7a9d873f7799d /indra/newview/llinventorymodel.cpp | |
| parent | ba6974eb376a50eb40dab1682fb96299fe97639d (diff) | |
MAINT-6959 Ability to set custom folders for uploading items
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
| -rw-r--r-- | indra/newview/llinventorymodel.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 503fa28a33..287fa4c45b 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -515,6 +515,42 @@ const LLUUID LLInventoryModel::findCategoryUUIDForType(LLFolderType::EType prefe return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getRootFolderID()); } +const LLUUID LLInventoryModel::findUserDefinedCategoryUUIDForType(LLFolderType::EType preferred_type) +{ + LLUUID cat_id; + switch (preferred_type) + { + case LLFolderType::FT_OBJECT: + { + cat_id = LLUUID(gSavedPerAccountSettings.getString("ModelUploadFolder")); + break; + } + case LLFolderType::FT_TEXTURE: + { + cat_id = LLUUID(gSavedPerAccountSettings.getString("TextureUploadFolder")); + break; + } + case LLFolderType::FT_SOUND: + { + cat_id = LLUUID(gSavedPerAccountSettings.getString("SoundUploadFolder")); + break; + } + case LLFolderType::FT_ANIMATION: + { + cat_id = LLUUID(gSavedPerAccountSettings.getString("AnimationUploadFolder")); + break; + } + default: + break; + } + + if (cat_id.isNull() || !getCategory(cat_id)) + { + cat_id = findCategoryUUIDForTypeInRoot(preferred_type, true, getRootFolderID()); + } + return cat_id; +} + const LLUUID LLInventoryModel::findLibraryCategoryUUIDForType(LLFolderType::EType preferred_type, bool create_folder) { return findCategoryUUIDForTypeInRoot(preferred_type, create_folder, gInventory.getLibraryRootFolderID()); |
