summaryrefslogtreecommitdiff
path: root/indra/newview/llfloatermarketplacelistings.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2015-02-03 23:43:15 -0800
committerMerov Linden <merov@lindenlab.com>2015-02-03 23:43:15 -0800
commitfe4f5f13da50bf833254b1d168de3b60d56f2bcb (patch)
tree27427272f060efc84ac4b01f40cca277a1bfd9fb /indra/newview/llfloatermarketplacelistings.cpp
parentab91c83881ae182de2ebf8e99d31db2c5bd39f08 (diff)
DD-303 : do not force unlist when associating listings, let the 1 version folder policy apply, prompt user only if it doesn't
Diffstat (limited to 'indra/newview/llfloatermarketplacelistings.cpp')
-rwxr-xr-xindra/newview/llfloatermarketplacelistings.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp
index cd76cabfbd..c1664631f0 100755
--- a/indra/newview/llfloatermarketplacelistings.cpp
+++ b/indra/newview/llfloatermarketplacelistings.cpp
@@ -636,6 +636,15 @@ void LLFloaterMarketplaceListings::onChanged()
// LLFloaterAssociateListing
//-----------------------------------------------------------------------------
+// Tell if a listing has one only version folder
+bool hasUniqueVersionFolder(const LLUUID& folder_id)
+{
+ LLInventoryModel::cat_array_t* categories;
+ LLInventoryModel::item_array_t* items;
+ gInventory.getDirectDescendentsOf(folder_id, categories, items);
+ return (categories->size() == 1);
+}
+
LLFloaterAssociateListing::LLFloaterAssociateListing(const LLSD& key)
: LLFloater(key)
, mUUID()
@@ -703,7 +712,7 @@ void LLFloaterAssociateListing::apply(BOOL user_confirm)
// Check if the id exists in the merchant SLM DB: note that this record might exist in the LLMarketplaceData
// structure even if unseen in the UI, for instance, if its listing_uuid doesn't exist in the merchant inventory
LLUUID listing_uuid = LLMarketplaceData::instance().getListingFolder(id);
- if (listing_uuid.notNull() && user_confirm && LLMarketplaceData::instance().getActivationState(listing_uuid))
+ if (listing_uuid.notNull() && user_confirm && LLMarketplaceData::instance().getActivationState(listing_uuid) && !hasUniqueVersionFolder(mUUID))
{
// Look for user confirmation before unlisting
LLNotificationsUtil::add("ConfirmMerchantUnlist", LLSD(), LLSD(), boost::bind(&LLFloaterAssociateListing::callback_apply, this, _1, _2));