diff options
author | Merov Linden <merov@lindenlab.com> | 2014-06-05 18:02:28 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-06-05 18:02:28 -0700 |
commit | 7911e32d4bd9f86bdde5771dcaa14203befa5f7d (patch) | |
tree | bc2e637ef21959871517987ffef1c936b58d7c0f /indra | |
parent | 252ad06b7bcc33a48b6c23917f6156a436df4b00 (diff) |
DD-114, DD-115, DD-116: Fixed counts on folder, folder depth and items on operations on marketplace listings
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 4 | ||||
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llinventoryfunctions.cpp | 21 |
3 files changed, 15 insertions, 14 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 71715ed801..1966e71360 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4696,7 +4696,7 @@ <key>Type</key> <string>U32</string> <key>Value</key> - <integer>21</integer> + <integer>20</integer> </map> <key>InventoryOutboxMaxFolderDepth</key> <map> @@ -4718,7 +4718,7 @@ <key>Type</key> <string>U32</string> <key>Value</key> - <integer>200</integer> + <integer>100</integer> </map> <key>InventorySortOrder</key> <map> diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 0f62c8555d..c50f3f8041 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -3290,11 +3290,11 @@ void LLFolderBridge::perform_pasteFromClipboard() LLInventoryItem *item = model->getItem(item_id); LLInventoryCategory *cat = model->getCategory(item_id); - if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg)) + if (item && !can_move_item_to_marketplace(master_folder, dest_folder, item, error_msg, objects.size())) { break; } - if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg)) + if (cat && !can_move_folder_to_marketplace(master_folder, dest_folder, cat, error_msg, objects.size())) { break; } diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index da8c03eb7c..b17e9551e5 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1092,13 +1092,14 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn { bool accept = true; - // Compute the nested folder levels we'll get into with that folder - int nested_folder_levels = get_folder_levels(inv_cat); - if (root_folder) - { - nested_folder_levels += get_folder_path_length(root_folder->getUUID(), dest_folder->getUUID()); - } - if (nested_folder_levels > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) + // Compute the nested folders level we'll add into with that incoming folder + int incoming_folder_depth = get_folder_levels(inv_cat); + // Compute the nested folders level we're inserting ourselves in + // Note: add one when inserting under a listing folder as we need to take the root listing folder in the count + int insertion_point_folder_depth = (root_folder ? get_folder_path_length(root_folder->getUUID(), dest_folder->getUUID()) + 1 : 0); + + // Compare the whole with the nested folders depth limit + if ((incoming_folder_depth + insertion_point_folder_depth) > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) { LLStringUtil::format_map_t args; U32 amount = gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"); @@ -1113,8 +1114,8 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn LLInventoryModel::item_array_t descendent_items; gInventory.collectDescendents(inv_cat->getUUID(), descendent_categories, descendent_items, FALSE); - int dragged_folder_count = descendent_categories.size() + 1; - int dragged_item_count = descendent_items.size() + bundle_size; + int dragged_folder_count = descendent_categories.size() + bundle_size; // Note: We assume that we're moving a bunch of folders in. That might be wrong... + int dragged_item_count = descendent_items.size(); int existing_item_count = 0; int existing_folder_count = 0; @@ -1124,7 +1125,7 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn { // Clear those counts or they will be counted twice because we're already inside the root category dragged_folder_count = 0; - dragged_item_count = bundle_size; + dragged_item_count = 0; } else { |