DD-129 : Prevent DAMA when dropping under the root of a listing, even active. Finer granularity of DAMA for all drop and cut and paste cases.
parent
9e7caa2e14
commit
51e8b7fae6
|
|
@ -271,7 +271,8 @@ BOOL LLInvFVBridge::cutToClipboard()
|
|||
const LLUUID &marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false);
|
||||
const BOOL cut_from_marketplacelistings = gInventory.isObjectDescendentOf(mUUID, marketplacelistings_id);
|
||||
|
||||
if (cut_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID))
|
||||
if (cut_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(mUUID) ||
|
||||
LLMarketplaceData::instance().isListedAndActive(mUUID)))
|
||||
{
|
||||
// Prompt the user if cutting from a marketplace active listing
|
||||
LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLInvFVBridge::callback_cutToClipboard, this, _1, _2));
|
||||
|
|
@ -2493,7 +2494,8 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat,
|
|||
// Dropping in or out of marketplace needs (sometimes) confirmation
|
||||
if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings))
|
||||
{
|
||||
if (move_is_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(cat_id))
|
||||
if (move_is_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(cat_id) ||
|
||||
LLMarketplaceData::instance().isListedAndActive(cat_id)))
|
||||
{
|
||||
if (LLMarketplaceData::instance().isListed(cat_id) || LLMarketplaceData::instance().isVersionFolder(cat_id))
|
||||
{
|
||||
|
|
@ -4283,7 +4285,8 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
|
|||
// Dropping in or out of marketplace needs (sometimes) confirmation
|
||||
if (user_confirm && (move_is_from_marketplacelistings || move_is_into_marketplacelistings))
|
||||
{
|
||||
if ((move_is_from_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(inv_item->getUUID())) ||
|
||||
if ((move_is_from_marketplacelistings && (LLMarketplaceData::instance().isInActiveFolder(inv_item->getUUID())
|
||||
|| LLMarketplaceData::instance().isListedAndActive(inv_item->getUUID()))) ||
|
||||
(move_is_into_marketplacelistings && LLMarketplaceData::instance().isInActiveFolder(mUUID)))
|
||||
{
|
||||
LLNotificationsUtil::add("ConfirmMerchantActiveChange", LLSD(), LLSD(), boost::bind(&LLFolderBridge::callback_dropItemIntoFolder, this, _1, _2, inv_item));
|
||||
|
|
|
|||
|
|
@ -1973,7 +1973,8 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
|
|||
}
|
||||
// Note: we do not prompt for change when opening items (e.g. textures or note cards) on the marketplace...
|
||||
}
|
||||
else if (LLMarketplaceData::instance().isInActiveFolder(viewModel->getUUID()))
|
||||
else if (LLMarketplaceData::instance().isInActiveFolder(viewModel->getUUID()) ||
|
||||
LLMarketplaceData::instance().isListedAndActive(viewModel->getUUID()))
|
||||
{
|
||||
// If item is in active listing, further confirmation is required
|
||||
if ((("cut" == action) || ("delete" == action)) && (LLMarketplaceData::instance().isListed(viewModel->getUUID()) || LLMarketplaceData::instance().isVersionFolder(viewModel->getUUID())))
|
||||
|
|
|
|||
|
|
@ -1431,6 +1431,11 @@ bool LLMarketplaceData::isListed(const LLUUID& folder_id)
|
|||
return (it != mMarketplaceItems.end());
|
||||
}
|
||||
|
||||
bool LLMarketplaceData::isListedAndActive(const LLUUID& folder_id)
|
||||
{
|
||||
return (isListed(folder_id) && getActivationState(folder_id));
|
||||
}
|
||||
|
||||
bool LLMarketplaceData::isVersionFolder(const LLUUID& folder_id)
|
||||
{
|
||||
marketplace_items_list_t::iterator it = mMarketplaceItems.begin();
|
||||
|
|
@ -1451,7 +1456,7 @@ bool LLMarketplaceData::isInActiveFolder(const LLUUID& obj_id)
|
|||
LLUUID listing_uuid = nested_parent_id(obj_id, depth);
|
||||
bool active = getActivationState(listing_uuid);
|
||||
LLUUID version_uuid = getVersionFolder(listing_uuid);
|
||||
return (active && ((obj_id == listing_uuid) || (obj_id == version_uuid) || gInventory.isObjectDescendentOf(obj_id, version_uuid)));
|
||||
return (active && ((obj_id == version_uuid) || gInventory.isObjectDescendentOf(obj_id, version_uuid)));
|
||||
}
|
||||
|
||||
// Private Modifiers
|
||||
|
|
|
|||
|
|
@ -197,6 +197,7 @@ public:
|
|||
|
||||
// Probe the Marketplace data set to identify folders
|
||||
bool isListed(const LLUUID& folder_id); // returns true if folder_id is a Listing folder
|
||||
bool isListedAndActive(const LLUUID& folder_id); // returns true if folder_id is an active (listed) Listing folder
|
||||
bool isVersionFolder(const LLUUID& folder_id); // returns true if folder_id is a Version folder
|
||||
bool isInActiveFolder(const LLUUID& obj_id); // returns true if the obj_id is buried in an active version folder
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue