summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp243
1 files changed, 136 insertions, 107 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index eac5661847..22ee036a6d 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -94,7 +94,7 @@
#include "llvoavatarself.h"
#include "llwearablelist.h"
-BOOL LLInventoryState::sWearNewClothing = FALSE;
+bool LLInventoryState::sWearNewClothing = false;
LLUUID LLInventoryState::sWearNewClothingTransactionID;
std::list<LLUUID> LLInventoryAction::sMarketplaceFolders;
bool LLInventoryAction::sDeleteConfirmationDisplayed = false;
@@ -159,7 +159,7 @@ S32 count_descendants_items(const LLUUID& cat_id)
LLInventoryModel::item_array_t* item_array;
gInventory.getDirectDescendentsOf(cat_id,cat_array,item_array);
- S32 count = item_array->size();
+ S32 count = static_cast<S32>(item_array->size());
LLInventoryModel::cat_array_t cat_array_copy = *cat_array;
for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
@@ -556,12 +556,12 @@ public:
}
};
-BOOL get_is_parent_to_worn_item(const LLUUID& id)
+bool get_is_parent_to_worn_item(const LLUUID& id)
{
const LLViewerInventoryCategory* cat = gInventory.getCategory(id);
if (!cat)
{
- return FALSE;
+ return false;
}
LLInventoryModel::cat_array_t cats;
@@ -588,7 +588,7 @@ BOOL get_is_parent_to_worn_item(const LLUUID& id)
if (cat == parent_cat)
{
- return TRUE;
+ return true;
}
parent_id = parent_cat->getParentUUID();
@@ -596,23 +596,23 @@ BOOL get_is_parent_to_worn_item(const LLUUID& id)
}
}
- return FALSE;
+ return false;
}
-BOOL get_is_item_worn(const LLUUID& id, const LLViewerInventoryItem* item)
+bool get_is_item_worn(const LLUUID& id, const LLViewerInventoryItem* item)
{
if (!item)
- return FALSE;
+ return false;
if (item->getIsLinkType() && !gInventory.getItem(item->getLinkedUUID()))
{
- return FALSE;
+ return false;
}
// Consider the item as worn if it has links in COF.
if (LLAppearanceMgr::instance().isLinkedInCOF(id))
{
- return TRUE;
+ return true;
}
switch(item->getType())
@@ -620,55 +620,55 @@ BOOL get_is_item_worn(const LLUUID& id, const LLViewerInventoryItem* item)
case LLAssetType::AT_OBJECT:
{
if (isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(item->getLinkedUUID()))
- return TRUE;
+ return true;
break;
}
case LLAssetType::AT_BODYPART:
case LLAssetType::AT_CLOTHING:
if(gAgentWearables.isWearingItem(item->getLinkedUUID()))
- return TRUE;
+ return true;
break;
case LLAssetType::AT_GESTURE:
if (LLGestureMgr::instance().isGestureActive(item->getLinkedUUID()))
- return TRUE;
+ return true;
break;
default:
break;
}
- return FALSE;
+ return false;
}
-BOOL get_is_item_worn(const LLUUID& id)
+bool get_is_item_worn(const LLUUID& id)
{
const LLViewerInventoryItem* item = gInventory.getItem(id);
return get_is_item_worn(id, item);
}
-BOOL get_is_item_worn(const LLViewerInventoryItem* item)
+bool get_is_item_worn(const LLViewerInventoryItem* item)
{
if (!item)
{
- return FALSE;
+ return false;
}
return get_is_item_worn(item->getUUID(), item);
}
-BOOL get_can_item_be_worn(const LLUUID& id)
+bool get_can_item_be_worn(const LLUUID& id)
{
const LLViewerInventoryItem* item = gInventory.getItem(id);
if (!item)
- return FALSE;
+ return false;
if (LLAppearanceMgr::instance().isLinkedInCOF(item->getLinkedUUID()))
{
// an item having links in COF (i.e. a worn item)
- return FALSE;
+ return false;
}
if (gInventory.isObjectDescendentOf(id, LLAppearanceMgr::instance().getCOF()))
{
// a non-link object in COF (should not normally happen)
- return FALSE;
+ return false;
}
const LLUUID trash_id = gInventory.findCategoryUUIDForType(
@@ -688,12 +688,12 @@ BOOL get_can_item_be_worn(const LLUUID& id)
if (isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(item->getLinkedUUID()))
{
// Already being worn
- return FALSE;
+ return false;
}
else
{
// Not being worn yet.
- return TRUE;
+ return true;
}
break;
}
@@ -702,18 +702,18 @@ BOOL get_can_item_be_worn(const LLUUID& id)
if(gAgentWearables.isWearingItem(item->getLinkedUUID()))
{
// Already being worn
- return FALSE;
+ return false;
}
else
{
// Not being worn yet.
- return TRUE;
+ return true;
}
break;
default:
break;
}
- return FALSE;
+ return false;
}
bool get_is_item_removable(const LLInventoryModel* model, const LLUUID& id, bool check_worn)
@@ -795,7 +795,7 @@ void handle_item_edit(const LLUUID& inv_item_id)
}
}
-BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
+bool get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
{
// NOTE: This function doesn't check the folder's children.
// See LLFolderBridge::isItemRemovable for a function that does
@@ -803,27 +803,27 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
if (!model)
{
- return FALSE;
+ return false;
}
if (!model->isObjectDescendentOf(id, gInventory.getRootFolderID()))
{
- return FALSE;
+ return false;
}
- if (!isAgentAvatarValid()) return FALSE;
+ if (!isAgentAvatarValid()) return false;
const LLInventoryCategory* category = model->getCategory(id);
if (!category)
{
- return FALSE;
+ return false;
}
const LLFolderType::EType folder_type = category->getPreferredType();
if (LLFolderType::lookupIsProtectedType(folder_type))
{
- return FALSE;
+ return false;
}
// Can't delete the outfit that is currently being worn.
@@ -832,11 +832,11 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id)
const LLViewerInventoryItem *base_outfit_link = LLAppearanceMgr::instance().getBaseOutfitLink();
if (base_outfit_link && (category == base_outfit_link->getLinkedCategory()))
{
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
bool get_is_category_and_children_removable(LLInventoryModel* model, const LLUUID& folder_id, bool check_worn)
@@ -901,11 +901,11 @@ bool get_is_category_and_children_removable(LLInventoryModel* model, const LLUUI
return true;
}
-BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id)
+bool get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id)
{
if (!model)
{
- return FALSE;
+ return false;
}
LLViewerInventoryCategory* cat = model->getCategory(id);
@@ -913,9 +913,9 @@ BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id)
if (cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType()) &&
cat->getOwnerID() == gAgent.getID())
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id)
@@ -1101,7 +1101,7 @@ S32 compute_stock_count(LLUUID cat_uuid, bool force_count /* false */)
LLInventoryModel::cat_array_t* cat_array;
LLInventoryModel::item_array_t* item_array;
gInventory.getDirectDescendentsOf(cat_uuid,cat_array,item_array);
- return item_array->size();
+ return static_cast<S32>(item_array->size());
}
// When force_count is true, we do not do any verification of the marketplace status and simply compute
@@ -1330,12 +1330,12 @@ bool can_move_item_to_marketplace(const LLInventoryCategory* root_folder, LLInve
if (accept)
{
// If the dest folder is a stock folder, we do not count the incoming items toward the total (stock items are seen as one)
- int existing_item_count = (move_in_stock ? 0 : bundle_size);
+ unsigned int existing_item_count = (move_in_stock ? 0 : bundle_size);
// If the dest folder is a stock folder, we do assume that the incoming items are also stock items (they should anyway)
- int existing_stock_count = (move_in_stock ? bundle_size : 0);
+ unsigned int existing_stock_count = (move_in_stock ? bundle_size : 0);
- int existing_folder_count = 0;
+ unsigned int existing_folder_count = 0;
// Get the version folder: that's where the counts start from
const LLViewerInventoryCategory * version_folder = ((root_folder && (root_folder != dest_folder)) ? gInventory.getFirstDescendantOf(root_folder->getUUID(), dest_folder->getUUID()) : NULL);
@@ -1351,11 +1351,11 @@ bool can_move_item_to_marketplace(const LLInventoryCategory* root_folder, LLInve
LLInventoryModel::cat_array_t existing_categories;
LLInventoryModel::item_array_t existing_items;
- gInventory.collectDescendents(version_folder->getUUID(), existing_categories, existing_items, FALSE);
+ gInventory.collectDescendents(version_folder->getUUID(), existing_categories, existing_items, false);
existing_item_count += count_copyable_items(existing_items) + count_stock_folders(existing_categories);
existing_stock_count += count_stock_items(existing_items);
- existing_folder_count += existing_categories.size();
+ existing_folder_count += static_cast<S32>(existing_categories.size());
// If the incoming item is a nocopy (stock) item, we need to consider that it will create a stock folder
if (!inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID()) && !move_in_stock)
@@ -1425,9 +1425,9 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn
{
LLInventoryModel::cat_array_t descendent_categories;
LLInventoryModel::item_array_t descendent_items;
- gInventory.collectDescendents(inv_cat->getUUID(), descendent_categories, descendent_items, FALSE);
+ gInventory.collectDescendents(inv_cat->getUUID(), descendent_categories, descendent_items, false);
- 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_folder_count = static_cast<int>(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 = count_copyable_items(descendent_items) + count_stock_folders(descendent_categories);
int dragged_stock_count = count_stock_items(descendent_items);
int existing_item_count = 0;
@@ -1447,16 +1447,16 @@ bool can_move_folder_to_marketplace(const LLInventoryCategory* root_folder, LLIn
// 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);
+ gInventory.collectDescendents(version_folder->getUUID(), existing_categories, existing_items, false);
- existing_folder_count += existing_categories.size();
+ existing_folder_count += static_cast<int>(existing_categories.size());
existing_item_count += count_copyable_items(existing_items) + count_stock_folders(existing_categories);
existing_stock_count += count_stock_items(existing_items);
}
- const int total_folder_count = existing_folder_count + dragged_folder_count;
- const int total_item_count = existing_item_count + dragged_item_count;
- const int total_stock_count = existing_stock_count + dragged_stock_count;
+ const unsigned int total_folder_count = existing_folder_count + dragged_folder_count;
+ const unsigned int total_item_count = existing_item_count + dragged_item_count;
+ const unsigned int total_stock_count = existing_stock_count + dragged_stock_count;
if (total_folder_count > gSavedSettings.getU32("InventoryOutboxMaxFolderCount"))
{
@@ -1879,7 +1879,7 @@ void validate_marketplacelistings(
}
// How many types of items? Which type is it if only one?
- S32 count = items_vector.size();
+ auto count = items_vector.size();
U32 default_key = (U32)(LLInventoryType::IT_COUNT) << 24; // This is the key for any normal copyable item
U32 unique_key = (count == 1 ? items_vector.begin()->first : default_key); // The key in the case of one item type only
@@ -2162,7 +2162,7 @@ void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id)
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(inv_item);
new_item->setParent(new_parent_id);
- new_item->updateParentOnServer(FALSE);
+ new_item->updateParentOnServer(false);
gInventory.updateItem(new_item);
gInventory.notifyObservers();
}
@@ -2202,7 +2202,7 @@ void move_items_to_folder(const LLUUID& new_cat_uuid, const uuid_vec_t& selected
LLFolderViewItem* fv_folder = sidepanel_inventory->getActivePanel()->getItemByID(new_cat_uuid);
if (fv_folder)
{
- fv_folder->setOpen(TRUE);
+ fv_folder->setOpen(true);
}
}
}
@@ -2266,7 +2266,7 @@ std::string get_category_path(LLUUID cat_id)
}
}
// Returns true if the item can be moved to Current Outfit or any outfit folder.
-bool can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit)
+bool can_move_to_outfit(LLInventoryItem* inv_item, bool move_is_into_current_outfit)
{
LLInventoryType::EType inv_type = inv_item->getInventoryType();
if ((inv_type != LLInventoryType::IT_WEARABLE) &&
@@ -2298,7 +2298,7 @@ bool can_move_to_outfit(LLInventoryItem* inv_item, BOOL move_is_into_current_out
return true;
}
-// Returns TRUE if item is a landmark or a link to a landmark
+// Returns true if item is a landmark or a link to a landmark
// and can be moved to Favorites or Landmarks folder.
bool can_move_to_landmarks(LLInventoryItem* inv_item)
{
@@ -2403,18 +2403,16 @@ void ungroup_folder_items(const LLUUID& folder_id)
LLInventoryModel::cat_array_t cats = *cat_array;
LLInventoryModel::item_array_t items = *item_array;
- for (LLInventoryModel::cat_array_t::const_iterator cat_iter = cats.begin(); cat_iter != cats.end(); ++cat_iter)
+ for (const LLPointer<LLViewerInventoryCategory>& cat : cats)
{
- LLViewerInventoryCategory* cat = *cat_iter;
if (cat)
{
gInventory.changeCategoryParent(cat, new_cat_uuid, false);
}
}
- for (LLInventoryModel::item_array_t::const_iterator item_iter = items.begin(); item_iter != items.end(); ++item_iter)
+ for (const LLPointer<LLViewerInventoryItem>& item : items)
{
- LLViewerInventoryItem* item = *item_iter;
- if(item)
+ if (item)
{
gInventory.changeItemParent(item, new_cat_uuid, false);
}
@@ -2564,8 +2562,7 @@ std::string get_searchable_description(LLInventoryModel* model, const LLUUID& it
{
if (model)
{
- const LLInventoryItem *item = model->getItem(item_id);
- if(item)
+ if (const LLInventoryItem* item = model->getItem(item_id))
{
std::string desc = item->getDescription();
LLStringUtil::toUpper(desc);
@@ -2579,8 +2576,7 @@ std::string get_searchable_creator_name(LLInventoryModel* model, const LLUUID& i
{
if (model)
{
- const LLInventoryItem *item = model->getItem(item_id);
- if(item)
+ if (const LLInventoryItem* item = model->getItem(item_id))
{
LLAvatarName av_name;
if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name))
@@ -2769,40 +2765,56 @@ bool LLIsType::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
{
if(mType == LLAssetType::AT_CATEGORY)
{
- if(cat) return TRUE;
+ if(cat) return true;
}
if(item)
{
- if(item->getType() == mType) return TRUE;
+ if(item->getType() == mType) return true;
}
- return FALSE;
+ return false;
+}
+
+bool LLIsOneOfTypes::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
+{
+ for (LLAssetType::EType &type : mTypes)
+ {
+ if (type == LLAssetType::AT_CATEGORY)
+ {
+ if (cat) return true;
+ }
+ if (item)
+ {
+ if (item->getType() == type) return true;
+ }
+ }
+ return false;
}
bool LLIsNotType::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
{
if(mType == LLAssetType::AT_CATEGORY)
{
- if(cat) return FALSE;
+ if(cat) return false;
}
if(item)
{
- if(item->getType() == mType) return FALSE;
- else return TRUE;
+ if(item->getType() == mType) return false;
+ else return true;
}
- return TRUE;
+ return true;
}
bool LLIsOfAssetType::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
{
if(mType == LLAssetType::AT_CATEGORY)
{
- if(cat) return TRUE;
+ if(cat) return true;
}
if(item)
{
- if(item->getActualType() == mType) return TRUE;
+ if(item->getActualType() == mType) return true;
}
- return FALSE;
+ return false;
}
bool LLAssetIDAndTypeMatches::operator()(LLInventoryCategory* cat, LLInventoryItem* item)
@@ -2824,7 +2836,7 @@ bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryIt
{
if(cat)
{
- return TRUE;
+ return true;
}
}
if(item)
@@ -2834,11 +2846,11 @@ bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryIt
LLPermissions perm = item->getPermissions();
if ((perm.getMaskBase() & mPerm) == mPerm)
{
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
bool LLFavoritesCollector::operator()(LLInventoryCategory* cat,
@@ -2896,10 +2908,10 @@ bool LLParticularBuddyCollector::operator()(LLInventoryCategory* cat,
if((LLAssetType::AT_CALLINGCARD == item->getType())
&& (item->getCreatorUUID() == mBuddyID))
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
@@ -2951,9 +2963,9 @@ bool LLFindBrokenLinks::operator()(LLInventoryCategory* cat,
// it is linked too
if (item && LLAssetType::lookupIsLinkType(item->getType()))
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool LLFindWearables::operator()(LLInventoryCategory* cat,
@@ -2964,10 +2976,10 @@ bool LLFindWearables::operator()(LLInventoryCategory* cat,
if((item->getType() == LLAssetType::AT_CLOTHING)
|| (item->getType() == LLAssetType::AT_BODYPART))
{
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
LLFindWearablesEx::LLFindWearablesEx(bool is_worn, bool include_body_parts)
@@ -3059,7 +3071,7 @@ bool LLLinkedItemIDMatches::operator()(LLInventoryCategory* cat, LLInventoryItem
(item->getLinkedUUID() == mBaseItemID)); // A linked item's assetID will be the compared-to item's itemID.
}
-void LLSaveFolderState::setApply(BOOL apply)
+void LLSaveFolderState::setApply(bool apply)
{
mApply = apply;
// before generating new list of open folders, clear the old one
@@ -3082,7 +3094,7 @@ void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
{
if (!folder->isOpen())
{
- folder->setOpen(TRUE);
+ folder->setOpen(true);
}
}
else
@@ -3090,7 +3102,7 @@ void LLSaveFolderState::doFolder(LLFolderViewFolder* folder)
// keep selected filter in its current state, this is less jarring to user
if (!folder->isSelected() && folder->isOpen())
{
- folder->setOpen(FALSE);
+ folder->setOpen(false);
}
}
}
@@ -3108,7 +3120,7 @@ void LLOpenFilteredFolders::doItem(LLFolderViewItem *item)
{
if (item->passedFilter())
{
- item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
+ item->getParentFolder()->setOpenArrangeRecursively(true, LLFolderViewFolder::RECURSE_UP);
}
}
@@ -3116,12 +3128,12 @@ void LLOpenFilteredFolders::doFolder(LLFolderViewFolder* folder)
{
if (folder->LLFolderViewItem::passedFilter() && folder->getParentFolder())
{
- folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
+ folder->getParentFolder()->setOpenArrangeRecursively(true, LLFolderViewFolder::RECURSE_UP);
}
// if this folder didn't pass the filter, and none of its descendants did
else if (!folder->getViewModelItem()->passedFilter() && !folder->getViewModelItem()->descendantsPassedFilter())
{
- folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_NO);
+ folder->setOpenArrangeRecursively(false, LLFolderViewFolder::RECURSE_NO);
}
}
@@ -3129,12 +3141,12 @@ void LLSelectFirstFilteredItem::doItem(LLFolderViewItem *item)
{
if (item->passedFilter() && !mItemSelected)
{
- item->getRoot()->setSelection(item, FALSE, FALSE);
+ item->getRoot()->setSelection(item, false, false);
if (item->getParentFolder())
{
- item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
+ item->getParentFolder()->setOpenArrangeRecursively(true, LLFolderViewFolder::RECURSE_UP);
}
- mItemSelected = TRUE;
+ mItemSelected = true;
}
}
@@ -3143,9 +3155,9 @@ void LLSelectFirstFilteredItem::doFolder(LLFolderViewFolder* folder)
// Skip if folder or item already found, if not filtered or if no parent (root folder is not selectable)
if (!mFolderSelected && !mItemSelected && folder->LLFolderViewItem::passedFilter() && folder->getParentFolder())
{
- folder->getRoot()->setSelection(folder, FALSE, FALSE);
- folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
- mFolderSelected = TRUE;
+ folder->getRoot()->setSelection(folder, false, false);
+ folder->getParentFolder()->setOpenArrangeRecursively(true, LLFolderViewFolder::RECURSE_UP);
+ mFolderSelected = true;
}
}
@@ -3153,7 +3165,7 @@ void LLOpenFoldersWithSelection::doItem(LLFolderViewItem *item)
{
if (item->getParentFolder() && item->isSelected())
{
- item->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
+ item->getParentFolder()->setOpenArrangeRecursively(true, LLFolderViewFolder::RECURSE_UP);
}
}
@@ -3161,7 +3173,7 @@ void LLOpenFoldersWithSelection::doFolder(LLFolderViewFolder* folder)
{
if (folder->getParentFolder() && folder->isSelected())
{
- folder->getParentFolder()->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP);
+ folder->getParentFolder()->setOpenArrangeRecursively(true, LLFolderViewFolder::RECURSE_UP);
}
}
@@ -3171,7 +3183,7 @@ void LLInventoryAction::callback_doToSelected(const LLSD& notification, const LL
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0) // YES
{
- doToSelected(model, root, action, FALSE);
+ doToSelected(model, root, action, false);
}
}
@@ -3180,11 +3192,11 @@ void LLInventoryAction::callback_copySelected(const LLSD& notification, const LL
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0) // YES, Move no copy item(s)
{
- doToSelected(model, root, "copy_or_move_to_marketplace_listings", FALSE);
+ doToSelected(model, root, "copy_or_move_to_marketplace_listings", false);
}
else if (option == 1) // NO, Don't move no copy item(s) (leave them behind)
{
- doToSelected(model, root, "copy_to_marketplace_listings", FALSE);
+ doToSelected(model, root, "copy_to_marketplace_listings", false);
}
}
@@ -3217,7 +3229,7 @@ bool get_selection_object_uuids(LLFolderView *root, uuid_vec_t& ids)
}
-void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action, BOOL user_confirm)
+void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action, bool user_confirm)
{
std::set<LLFolderViewItem*> selected_items = root->getSelectionList();
if (selected_items.empty()
@@ -3335,7 +3347,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
LLInventoryModel::cat_array_t categories;
LLInventoryModel::item_array_t items;
- gInventory.collectDescendents(obj_id, categories, items, FALSE);
+ gInventory.collectDescendents(obj_id, categories, items, false);
for (LLInventoryModel::item_array_t::value_type& item : items)
{
@@ -3623,6 +3635,23 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
set_favorite(id, false);
}
}
+ else if ("thumbnail" == action)
+ {
+ if (selected_items.size() > 0)
+ {
+ LLSD data;
+ std::set<LLFolderViewItem*>::iterator set_iter;
+ for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter)
+ {
+ LLFolderViewItem* folder_item = *set_iter;
+ if (!folder_item) continue;
+ LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getViewModelItem();
+ if (!bridge) continue;
+ data.append(bridge->getUUID());
+ }
+ LLFloaterReg::showInstance("change_item_thumbnail", data);
+ }
+ }
else
{
std::set<LLFolderViewItem*>::iterator set_iter;
@@ -3760,7 +3789,7 @@ void LLInventoryAction::fileUploadLocation(const LLUUID& dest_id, const std::str
}
else if (action == "upload_bulk")
{
- LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, dest_id), LLFilePicker::FFLOAD_ALL, true);
+ LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, true, dest_id), LLFilePicker::FFLOAD_ALL, true);
}
}
@@ -3798,7 +3827,7 @@ void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, con
LLInventoryModel::cat_array_t categories;
LLInventoryModel::item_array_t items;
- gInventory.collectDescendents(obj_id, categories, items, FALSE);
+ gInventory.collectDescendents(obj_id, categories, items, false);
for (LLInventoryModel::item_array_t::value_type& item : items)
{
@@ -3836,11 +3865,11 @@ void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, con
{
for (const LLUUID& id : item_deletion_list)
{
- remove_inventory_item(id, NULL);
+ gInventory.removeItem(id);
}
for (const LLUUID& id : cat_deletion_list)
{
- remove_inventory_category(id, NULL);
+ gInventory.removeCategory(id);
}
});
}