Skip to content
Snippets Groups Projects
Commit e07bc619 authored by Merov Linden's avatar Merov Linden
Browse files

DD-322 : Use vector of UUIDs instead of pointers to items when reparenting those items

parent 36d85815
No related branches found
No related tags found
No related merge requests found
...@@ -1619,7 +1619,7 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ ...@@ -1619,7 +1619,7 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
// * have stock items nested at depth 2 at least // * have stock items nested at depth 2 at least
// * never ever move the non-stock items // * never ever move the non-stock items
std::vector<std::vector<LLViewerInventoryItem*> > items_vector; std::vector<std::vector<LLUUID> > items_vector;
items_vector.resize(LLInventoryType::IT_COUNT+1); items_vector.resize(LLInventoryType::IT_COUNT+1);
// Parse the items and create vectors of items to sort copyable items and stock items of various types // Parse the items and create vectors of items to sort copyable items and stock items of various types
...@@ -1649,7 +1649,7 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ ...@@ -1649,7 +1649,7 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
// Get the item type for stock items // Get the item type for stock items
type = viewer_inv_item->getInventoryType(); type = viewer_inv_item->getInventoryType();
} }
items_vector[type].push_back(viewer_inv_item); items_vector[type].push_back(viewer_inv_item->getUUID());
} }
// How many types of folders? Which type is it if only one? // How many types of folders? Which type is it if only one?
...@@ -1725,7 +1725,7 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ ...@@ -1725,7 +1725,7 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
{ {
// Create a new folder // Create a new folder
LLUUID parent_uuid = (depth > 2 ? viewer_cat->getParentUUID() : viewer_cat->getUUID()); LLUUID parent_uuid = (depth > 2 ? viewer_cat->getParentUUID() : viewer_cat->getUUID());
LLViewerInventoryItem* viewer_inv_item = items_vector[i].back(); LLViewerInventoryItem* viewer_inv_item = gInventory.getItem(items_vector[i].back());
std::string folder_name = (depth > 1 ? viewer_cat->getName() : viewer_inv_item->getName()); std::string folder_name = (depth > 1 ? viewer_cat->getName() : viewer_inv_item->getName());
LLFolderType::EType new_folder_type = (i == LLInventoryType::IT_COUNT ? LLFolderType::FT_NONE : LLFolderType::FT_MARKETPLACE_STOCK); LLFolderType::EType new_folder_type = (i == LLInventoryType::IT_COUNT ? LLFolderType::FT_NONE : LLFolderType::FT_MARKETPLACE_STOCK);
if (cb) if (cb)
...@@ -1742,10 +1742,11 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_ ...@@ -1742,10 +1742,11 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
cb(message,depth,LLError::LEVEL_WARN); cb(message,depth,LLError::LEVEL_WARN);
} }
LLUUID folder_uuid = gInventory.createNewCategory(parent_uuid, new_folder_type, folder_name); LLUUID folder_uuid = gInventory.createNewCategory(parent_uuid, new_folder_type, folder_name);
// Move each item to the new folder // Move each item to the new folder
while (!items_vector[i].empty()) while (!items_vector[i].empty())
{ {
LLViewerInventoryItem* viewer_inv_item = items_vector[i].back(); LLViewerInventoryItem* viewer_inv_item = gInventory.getItem(items_vector[i].back());
if (cb) if (cb)
{ {
std::string message = indent + viewer_inv_item->getName() + LLTrans::getString("Marketplace Validation Warning Move"); std::string message = indent + viewer_inv_item->getName() + LLTrans::getString("Marketplace Validation Warning Move");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment