diff options
author | Merov Linden <merov@lindenlab.com> | 2014-04-13 22:24:58 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-04-13 22:24:58 -0700 |
commit | eb8c0bf086f66ce1ee7d373ceaaba64a113bf1fd (patch) | |
tree | d5cdf35ba671f83ae853c1a2c455d2105b601fbe | |
parent | ae94a0d06962bc9615bcae2e75dd6cd23fa1067e (diff) |
DD-59 : Takes care of the case of a stock folder at the level of a listing folder
-rwxr-xr-x | indra/newview/llinventoryfunctions.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index a0aa06ddf2..c7cd38b20e 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1038,14 +1038,25 @@ bool has_correct_permissions_for_sale(LLInventoryCategory* cat) // *TODO : Add the rest of the SLM/AIS business logic (limit of nesting depth, stock folder consistency, overall limit on listings, etc...) void validate_marketplacelistings(LLInventoryCategory* cat) { + // Special case a stock folder depth issue + LLViewerInventoryCategory * viewer_cat = (LLViewerInventoryCategory *) (cat); + const LLFolderType::EType folder_type = cat->getPreferredType(); + S32 depth = depth_nesting_in_marketplace(cat->getUUID()); + if ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (depth == 1)) + { + // Nest the stock folder one level deeper in a normal folder and restart from there + LLUUID parent_uuid = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + LLUUID folder_uuid = gInventory.createNewCategory(parent_uuid, LLFolderType::FT_NONE, cat->getName()); + LLInventoryCategory* new_cat = gInventory.getCategory(folder_uuid); + gInventory.changeCategoryParent(viewer_cat, folder_uuid, false); + validate_marketplacelistings(new_cat); + return; + } + LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; gInventory.getDirectDescendentsOf(cat->getUUID(),cat_array,item_array); - LLViewerInventoryCategory * viewer_cat = (LLViewerInventoryCategory *) (cat); - const LLFolderType::EType folder_type = cat->getPreferredType(); - S32 depth = depth_nesting_in_marketplace(cat->getUUID()); - // Stock items : sorting and moving the various stock items is complicated as the set of constraints is high // For each folder, we need to: // * separate non stock items, stock items per types in different folders |