From 0ec8fbec6deaa24506391ef239c50009eebe1eef Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 28 Mar 2014 15:54:36 -0700 Subject: DD-24 : Add FT_MARKETPLACE_STOCK as a new type for folders, implement the promotion code for Drag and Drop, display of stock folders and embryonic marketplace validation --- indra/newview/llinventorymodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index ed7fd3cd34..37e11123c6 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2160,12 +2160,12 @@ void LLInventoryModel::buildParentChildMap() // implement it, we would need a set or map of uuid pairs // which would be (folder_id, new_parent_id) to be sent up // to the server. - llinfos << "Lost categroy: " << cat->getUUID() << " - " + llinfos << "Lost category: " << cat->getUUID() << " - " << cat->getName() << llendl; ++lost; // plop it into the lost & found. LLFolderType::EType pref = cat->getPreferredType(); - if(LLFolderType::FT_NONE == pref) + if ((LLFolderType::FT_NONE == pref) || (LLFolderType::FT_MARKETPLACE_STOCK == pref)) { cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND)); } -- cgit v1.2.3 From 69fb50322eb0de9071ed22d4e62cef11ae811c4d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 31 Mar 2014 20:24:41 -0700 Subject: DD-18 : WIP : Making stock folders update work better --- indra/newview/llinventorymodel.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 37e11123c6..96a2db5afb 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1027,7 +1027,7 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) LLViewerInventoryCategory* old_cat = getCategory(cat->getUUID()); if(old_cat) { - // We already have an old category, modify it's values + // We already have an old category, modify its values U32 mask = LLInventoryObserver::NONE; LLUUID old_parent_id = old_cat->getParentUUID(); LLUUID new_parent_id = cat->getParentUUID(); @@ -1052,7 +1052,13 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) { mask |= LLInventoryObserver::LABEL; } - old_cat->copyViewerCategory(cat); + // Under marketplace, category labels are quite complex and need extra upate + const LLUUID marketplace_id = findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); + if (marketplace_id.notNull() && isObjectDescendentOf(cat->getUUID(), marketplace_id)) + { + mask |= LLInventoryObserver::LABEL; + } + old_cat->copyViewerCategory(cat); addChangedMask(mask, cat->getUUID()); } else -- cgit v1.2.3 From f66de28a7cf735df15d167df270943547bdbde81 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 1 Apr 2014 21:41:18 -0700 Subject: DD-20 : WIP : Implemented the cut and paste code for marketplace. Stock update still not working as expected. --- indra/newview/llinventorymodel.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 96a2db5afb..afddde02a4 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1056,7 +1056,10 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) const LLUUID marketplace_id = findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); if (marketplace_id.notNull() && isObjectDescendentOf(cat->getUUID(), marketplace_id)) { + // *TODO : Need some internal analysis to be less brutal with updates mask |= LLInventoryObserver::LABEL; + mask |= LLInventoryObserver::STRUCTURE; + mask |= LLInventoryObserver::INTERNAL; } old_cat->copyViewerCategory(cat); addChangedMask(mask, cat->getUUID()); -- cgit v1.2.3 From a98346b0c3b90e75858f6ef98985c1246ad30418 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 2 Apr 2014 18:06:22 -0700 Subject: DD-20 : WIP : Improve Cut and Paste for marketplace. Still some use cases that are not working well --- indra/newview/llinventorymodel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index afddde02a4..269542d383 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1056,11 +1056,9 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) const LLUUID marketplace_id = findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false); if (marketplace_id.notNull() && isObjectDescendentOf(cat->getUUID(), marketplace_id)) { - // *TODO : Need some internal analysis to be less brutal with updates mask |= LLInventoryObserver::LABEL; - mask |= LLInventoryObserver::STRUCTURE; - mask |= LLInventoryObserver::INTERNAL; } + llinfos << "Merov : updateCategory : " << cat->getName() << llendl; old_cat->copyViewerCategory(cat); addChangedMask(mask, cat->getUUID()); } -- cgit v1.2.3 From 39659f3c034c5cb335e185d1411e808d272f8065 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 3 Apr 2014 15:17:31 -0700 Subject: DD-20 : Handle edge cases a bit more cleanly --- indra/newview/llinventorymodel.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 269542d383..96a2db5afb 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1058,7 +1058,6 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) { mask |= LLInventoryObserver::LABEL; } - llinfos << "Merov : updateCategory : " << cat->getName() << llendl; old_cat->copyViewerCategory(cat); addChangedMask(mask, cat->getUUID()); } -- cgit v1.2.3 From fc4e9d2572635903449ade6ebf2a45aa9e971023 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 8 Apr 2014 18:12:48 -0700 Subject: DD-18 : Compute stock for all levels, get folders to update more consistently on all actions in the marketplace --- indra/newview/llinventorymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 96a2db5afb..c0aedd3881 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1013,7 +1013,7 @@ LLInventoryModel::item_array_t* LLInventoryModel::getUnlockedItemArray(const LLU // an existing item with the matching id, or it will add the category. void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) { - if(cat->getUUID().isNull()) + if(!cat || cat->getUUID().isNull()) { return; } -- cgit v1.2.3 From 87192990592f9abda8314393bdcac3627c15d5ac Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 1 May 2014 17:36:17 -0700 Subject: DD-81 : Fixed the stock folder count update using an inventory observer. This observe other changes as well of interest to marketplace and should improve consistency in general --- indra/newview/llinventorymodel.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index c0aedd3881..0fbccb2f3f 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1441,16 +1441,17 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) } mModifyMask |= mask; - if (referent.notNull()) + if (referent.notNull() && (mChangedItemIDs.find(referent) == mChangedItemIDs.end())) { mChangedItemIDs.insert(referent); - } + update_marketplace_category(referent); - // Update all linked items. Starting with just LABEL because I'm - // not sure what else might need to be accounted for this. - if (mModifyMask & LLInventoryObserver::LABEL) - { - addChangedMaskForLinks(referent, LLInventoryObserver::LABEL); + // Update all linked items. Starting with just LABEL because I'm + // not sure what else might need to be accounted for this. + if (mModifyMask & LLInventoryObserver::LABEL) + { + addChangedMaskForLinks(referent, LLInventoryObserver::LABEL); + } } } -- cgit v1.2.3 From 23acc30e2709dac1aa54eecda5c1bc6b2b226b5b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 16 May 2014 17:12:22 -0700 Subject: DD-102 : Fix crash when emptying trash containing nested folders. Also avoid getting listings several times --- indra/newview/llinventorymodel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 0fbccb2f3f..c379fb5f3a 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1217,6 +1217,11 @@ void LLInventoryModel::deleteObject(const LLUUID& id) LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)((LLInventoryObject*)obj); cat_list->removeObj(cat); } + + // Note : We need to tell the inventory observers that those things are going to be deleted *before* the tree is cleared or they won't know what to delete (in views and view models) + addChangedMask(LLInventoryObserver::REMOVE, id); + gInventory.notifyObservers(); + item_list = getUnlockedItemArray(id); if(item_list) { @@ -1229,10 +1234,8 @@ void LLInventoryModel::deleteObject(const LLUUID& id) delete cat_list; mParentChildCategoryTree.erase(id); } - addChangedMask(LLInventoryObserver::REMOVE, id); obj = NULL; // delete obj updateLinkedObjectsFromPurge(id); - gInventory.notifyObservers(); } // Delete a particular inventory item by ID, and remove it from the server. -- cgit v1.2.3 From 86d75052f65149da6bbe1ade5ea28b6f01aaba17 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 3 Jun 2014 19:46:33 -0700 Subject: DD-84 : Fix all active listing modification actions. Add specific message when listing will unlist. Make update skip consistency check when called from internal level (not public API). --- indra/newview/llinventorymodel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 8f8ea8e602..110f514017 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1537,11 +1537,11 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) } } - mModifyMask |= mask; + mModifyMask |= mask; if (referent.notNull() && (mChangedItemIDs.find(referent) == mChangedItemIDs.end())) { mChangedItemIDs.insert(referent); - update_marketplace_category(referent); + update_marketplace_category(referent, true); if (mask & LLInventoryObserver::ADD) { -- cgit v1.2.3 From 252ad06b7bcc33a48b6c23917f6156a436df4b00 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 4 Jun 2014 09:58:11 -0700 Subject: DD-84 : Final clean up for this fix --- indra/newview/llinventorymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 110f514017..ea9658e51e 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1541,7 +1541,7 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) if (referent.notNull() && (mChangedItemIDs.find(referent) == mChangedItemIDs.end())) { mChangedItemIDs.insert(referent); - update_marketplace_category(referent, true); + update_marketplace_category(referent, false); if (mask & LLInventoryObserver::ADD) { -- cgit v1.2.3 From 84b3899af26bdc8995641e3b89882fab4a79add1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sat, 28 Mar 2015 14:32:50 -0700 Subject: DD-291 : Trigger a GET /listing when receiving a category update --- indra/newview/llinventorymodel.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 1cfa0a9ebf..b44bd38841 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -41,6 +41,7 @@ #include "llinventoryobserver.h" #include "llinventorypanel.h" #include "llnotificationsutil.h" +#include "llmarketplacefunctions.h" #include "llwindow.h" #include "llviewercontrol.h" #include "llpreview.h" @@ -3059,6 +3060,15 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) LL_DEBUGS("Inventory") << "unpacked folder '" << tfolder->getName() << "' (" << tfolder->getUUID() << ") in " << tfolder->getParentUUID() << LL_ENDL; + + // If the parent folder is a listing folder, we also need to update the SLM data + if (LLMarketplaceData::instance().isListed(tfolder->getParentUUID())) + { + // Trigger an SLM listing update + S32 listing_id = LLMarketplaceData::instance().getListingID(tfolder->getParentUUID()); + LLMarketplaceData::instance().getListing(listing_id); + } + if(tfolder->getUUID().notNull()) { folders.push_back(tfolder); -- cgit v1.2.3 From 0118a862fb63971b8b718ebecf72292b8318e464 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 1 Apr 2015 21:54:07 -0700 Subject: DD-291 : Fix code path on category update in the SLM update case --- indra/newview/llinventorymodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b44bd38841..9f621b1e88 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3061,15 +3061,15 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) << tfolder->getUUID() << ") in " << tfolder->getParentUUID() << LL_ENDL; - // If the parent folder is a listing folder, we also need to update the SLM data + // If the parent folder is a listing folder, all we need to do is update the SLM data if (LLMarketplaceData::instance().isListed(tfolder->getParentUUID())) { // Trigger an SLM listing update S32 listing_id = LLMarketplaceData::instance().getListingID(tfolder->getParentUUID()); LLMarketplaceData::instance().getListing(listing_id); + // In that case, there is no item to update so no callback -> we skip the rest of the update } - - if(tfolder->getUUID().notNull()) + else if(tfolder->getUUID().notNull()) { folders.push_back(tfolder); LLViewerInventoryCategory* folderp = gInventory.getCategory(tfolder->getUUID()); -- cgit v1.2.3 From 32e5d99c9d4b14116eb12a49e9349ee7b1802ee4 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 2 Apr 2015 21:40:22 -0700 Subject: DD-291 : Use a heavier but more resilient test for listing updates --- indra/newview/llinventorymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 9f621b1e88..8c4be57aaa 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3062,7 +3062,7 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) << LL_ENDL; // If the parent folder is a listing folder, all we need to do is update the SLM data - if (LLMarketplaceData::instance().isListed(tfolder->getParentUUID())) + if (depth_nesting_in_marketplace(tfolder->getParentUUID()) == 1) { // Trigger an SLM listing update S32 listing_id = LLMarketplaceData::instance().getListingID(tfolder->getParentUUID()); -- cgit v1.2.3 From 68771449157d27309ea77119d50dd8da31db1b23 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 9 Apr 2015 16:47:46 -0700 Subject: DD-384, DD-388 : Do not trust cached values for stock folders, do not consider a non fetched stock folder empty --- indra/newview/llinventorymodel.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 8c4be57aaa..5139564a6d 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1995,17 +1995,22 @@ bool LLInventoryModel::loadSkeleton( // we can safely ignore anything loaded from file, but // not sent down in the skeleton. Must have been removed from inventory. - if(cit == not_cached) + if (cit == not_cached) { continue; } - if(cat->getVersion() != tcat->getVersion()) + else if (cat->getVersion() != tcat->getVersion()) { // if the cached version does not match the server version, // throw away the version we have so we can fetch the // correct contents the next time the viewer opens the folder. tcat->setVersion(NO_VERSION); } + else if (tcat->getPreferredType() == LLFolderType::FT_MARKETPLACE_STOCK) + { + // Do not trust stock folders being updated + tcat->setVersion(NO_VERSION); + } else { cached_ids.insert(tcat->getUUID()); -- cgit v1.2.3 From 1717a7edbd8be48155685afb2ac1601cc971dee6 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 1 May 2015 14:28:58 -0700 Subject: DD-379 : React on update for both listing and version folders --- indra/newview/llinventorymodel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 5139564a6d..0bad4702e0 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3066,11 +3066,13 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) << tfolder->getUUID() << ") in " << tfolder->getParentUUID() << LL_ENDL; - // If the parent folder is a listing folder, all we need to do is update the SLM data - if (depth_nesting_in_marketplace(tfolder->getParentUUID()) == 1) + // If the folder is a listing or a version folder, all we need to do is update the SLM data + int depth_folder = depth_nesting_in_marketplace(tfolder->getUUID()); + if ((depth_folder == 1) || (depth_folder == 2)) { // Trigger an SLM listing update - S32 listing_id = LLMarketplaceData::instance().getListingID(tfolder->getParentUUID()); + LLUUID listing_uuid = (depth_folder == 1 ? tfolder->getUUID() : tfolder->getParentUUID()); + S32 listing_id = LLMarketplaceData::instance().getListingID(listing_uuid); LLMarketplaceData::instance().getListing(listing_id); // In that case, there is no item to update so no callback -> we skip the rest of the update } -- cgit v1.2.3