diff options
| author | AndreyL ProductEngine <andreylproductengine@lindenlab.com> | 2015-08-04 05:00:59 +0300 |
|---|---|---|
| committer | AndreyL ProductEngine <andreylproductengine@lindenlab.com> | 2015-08-04 05:00:59 +0300 |
| commit | b5378f93b298098cf841286ba6eb970ee5d855eb (patch) | |
| tree | c2f395318d33ae90c12d88d4258796b7ce6db62d /indra/newview/llviewerinventory.cpp | |
| parent | 8f5676202821b9b8addb19fe8b93bac56057c6af (diff) | |
| parent | 310ec101dfd2c69ecc1a51d0a3a8ea12d5fdaf7a (diff) | |
Merge viewer-release and become version 3.8.3
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
| -rwxr-xr-x | indra/newview/llviewerinventory.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index a8634d1e93..24096e3222 100755 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -808,6 +808,36 @@ bool LLViewerInventoryCategory::exportFileLocal(LLFILE* fp) const return true; } +bool LLViewerInventoryCategory::acceptItem(LLInventoryItem* inv_item) +{ + if (!inv_item) + { + return false; + } + + // Only stock folders have limitation on which item they will accept + bool accept = true; + if (getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + // If the item is copyable (i.e. non stock) do not accept the drop in a stock folder + if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + accept = false; + } + else + { + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(getUUID(),cat_array,item_array); + // Destination stock folder must be empty OR types of incoming and existing items must be identical and have the same permissions + accept = (!item_array->size() || + ((item_array->at(0)->getInventoryType() == inv_item->getInventoryType()) && + (item_array->at(0)->getPermissions().getMaskNextOwner() == inv_item->getPermissions().getMaskNextOwner()))); + } + } + return accept; +} + void LLViewerInventoryCategory::determineFolderType() { /* Do NOT uncomment this code. This is for future 2.1 support of ensembles. |
