summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorandreykproductengine <akleshchev@productengine.com>2015-07-15 16:06:55 +0300
committerandreykproductengine <akleshchev@productengine.com>2015-07-15 16:06:55 +0300
commitd092e375fdc3d69028dd1ce246acd8e9541303b9 (patch)
treed86168d47ea3baa5e98b9d7060837fb3c5005211 /indra/newview/llinventoryfunctions.cpp
parent2684c536906388da121ce2712a34d55aa786fa3f (diff)
parent02441157a0d22619ccf2a2ee735c8f5251b54fdb (diff)
Merge downstream code and become version 3.8.2
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp35
1 files changed, 31 insertions, 4 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 4075c329b9..6f6861dc7b 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -231,7 +231,7 @@ BOOL get_is_item_worn(const LLUUID& id)
return FALSE;
// Consider the item as worn if it has links in COF.
- if (LLAppearanceMgr::instance().isLinkInCOF(id))
+ if (LLAppearanceMgr::instance().isLinkedInCOF(id))
{
return TRUE;
}
@@ -265,7 +265,7 @@ BOOL get_can_item_be_worn(const LLUUID& id)
if (!item)
return FALSE;
- if (LLAppearanceMgr::isLinkInCOF(item->getLinkedUUID()))
+ if (LLAppearanceMgr::instance().isLinkedInCOF(item->getLinkedUUID()))
{
// an item having links in COF (i.e. a worn item)
return FALSE;
@@ -1061,6 +1061,34 @@ void LLOpenFoldersWithSelection::doFolder(LLFolderViewFolder* folder)
}
}
+// Succeeds iff all selected items are bridges to objects, in which
+// case returns their corresponding uuids.
+bool get_selection_object_uuids(LLFolderView *root, uuid_vec_t& ids)
+{
+ uuid_vec_t results;
+ S32 non_object = 0;
+ LLFolderView::selected_items_t selectedItems = root->getSelectedItems();
+ for(LLFolderView::selected_items_t::iterator it = selectedItems.begin(); it != selectedItems.end(); ++it)
+ {
+ LLObjectBridge *view_model = dynamic_cast<LLObjectBridge *>((*it)->getViewModelItem());
+
+ if(view_model && view_model->getUUID().notNull())
+ {
+ results.push_back(view_model->getUUID());
+ }
+ else
+ {
+ non_object++;
+ }
+ }
+ if (non_object == 0)
+ {
+ ids = results;
+ return true;
+ }
+ return false;
+}
+
void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action)
{
if ("rename" == action)
@@ -1115,7 +1143,6 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
LLFloater::setFloaterHost(multi_propertiesp);
}
-
std::set<LLUUID> selected_uuid_set = LLAvatarActions::getInventorySelectedUUIDs();
uuid_vec_t ids;
std::copy(selected_uuid_set.begin(), selected_uuid_set.end(), std::back_inserter(ids));
@@ -1128,7 +1155,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
{
wear_multiple(ids, false);
}
- else if (action == "take_off" || action == "detach")
+ else if (isRemoveAction(action))
{
LLAppearanceMgr::instance().removeItemsFromAvatar(ids);
}