diff options
author | Merov Linden <merov@lindenlab.com> | 2014-06-11 19:19:44 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-06-11 19:19:44 -0700 |
commit | 10dc6854a8f677c206aa9d3595f63223d542260e (patch) | |
tree | 16dc3dd6e48cb94e8ef3fa48629f09cd883f08cf /indra/newview | |
parent | 40e847d6f1d42ac7a97396de31b362a788638959 (diff) |
DD-130 : Count all folders and subfolders from the version folder excluding the version folder itself
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llinventoryfunctions.cpp | 18 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/strings.xml | 4 |
2 files changed, 6 insertions, 16 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 71f80e8bd5..78b3d71872 100755 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -1098,14 +1098,15 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn // 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 + // Note: add 1 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); - // Get the version folder: that's where the counts start from + // Get the version folder: that's where the folders and items counts start from const LLViewerInventoryCategory * version_folder = (insertion_point_folder_depth >= 2 ? gInventory.getFirstDescendantOf(root_folder->getUUID(), dest_folder->getUUID()) : NULL); // Compare the whole with the nested folders depth limit - if ((incoming_folder_depth + insertion_point_folder_depth) > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) + // Note: substract 2 as we leave root and version folder out of the count threshold + if ((incoming_folder_depth + insertion_point_folder_depth - 2) > gSavedSettings.getU32("InventoryOutboxMaxFolderDepth")) { LLStringUtil::format_map_t args; U32 amount = gSavedSettings.getU32("InventoryOutboxMaxFolderDepth"); @@ -1133,26 +1134,15 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn dragged_folder_count = 0; dragged_item_count = 0; } - else - { - existing_folder_count += 2; // Include the version and root folders in the count! - } // Tally the total number of categories and items inside the root folder - LLInventoryModel::cat_array_t existing_categories; LLInventoryModel::item_array_t existing_items; - gInventory.collectDescendents(version_folder->getUUID(), existing_categories, existing_items, FALSE); existing_folder_count += existing_categories.size(); existing_item_count += existing_items.size(); } - else if (root_folder) - { - // Not in a version folder but inside a listing folder: we're being inserted as a version folder then - existing_folder_count += 1; // Include the root folder in the count! - } const int total_folder_count = existing_folder_count + dragged_folder_count; const int total_item_count = existing_item_count + dragged_item_count; diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 2e8970b09f..2db84f2ab0 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -217,8 +217,8 @@ Please try logging in again in a minute.</string> <string name="TooltipOutboxLinked">You can not put linked items or folders on the marketplace</string> <string name="TooltipOutboxCallingCard">You can not put calling cards on the marketplace</string> <string name="TooltipOutboxFolderLevels">Depth of nested folders exceeds [AMOUNT]</string> - <string name="TooltipOutboxTooManyFolders">Subfolder count in top-level folder exceeds [AMOUNT]</string> - <string name="TooltipOutboxTooManyObjects">Item count in top-level folder exceeds [AMOUNT]</string> + <string name="TooltipOutboxTooManyFolders">Subfolders count exceeds [AMOUNT]</string> + <string name="TooltipOutboxTooManyObjects">Items count exceeds [AMOUNT]</string> <string name="TooltipOutboxDragActive">You can't move an active listed listing</string> <string name="TooltipDragOntoOwnChild">You can't move a folder into its child</string> |