From e7f141add9e19e91a76ecff41d90a0d620e795ae Mon Sep 17 00:00:00 2001 From: Ansariel Date: Sat, 12 Nov 2016 01:52:27 +0100 Subject: [PATCH] FIRE-15538: Link replace floater should update "remaining items" count after the item has actually been removed (wait for callback on AIS3) --- indra/newview/fsfloaterlinkreplace.cpp | 18 +++++++++++------- indra/newview/fsfloaterlinkreplace.h | 2 ++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/indra/newview/fsfloaterlinkreplace.cpp b/indra/newview/fsfloaterlinkreplace.cpp index 7284419d51..764a3d59f9 100644 --- a/indra/newview/fsfloaterlinkreplace.cpp +++ b/indra/newview/fsfloaterlinkreplace.cpp @@ -216,6 +216,7 @@ void FSFloaterLinkReplace::linkCreatedCallback(const LLUUID& old_item_id, } } + LLUUID outfit_update_folder = LLUUID::null; if (needs_wearable_ordering_update && outfit_folder_id.notNull()) { // If a wearable item was involved in the link replace operation and replaced @@ -223,15 +224,18 @@ void FSFloaterLinkReplace::linkCreatedCallback(const LLUUID& old_item_id, // *after* the original link has been removed. LLAppearanceMgr abuses the actual link // description to store the clothing ordering information it. We will have to update // the clothing ordering information or the outfit will be in dirty state when worn. - LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(&LLAppearanceMgr::updateClothingOrderingInfo, - LLAppearanceMgr::getInstance(), - outfit_folder_id, - LLPointer(NULL))); - remove_inventory_object(old_item_id, cb); + outfit_update_folder = outfit_folder_id; } - else + + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(&FSFloaterLinkReplace::itemRemovedCallback, this, outfit_update_folder)); + remove_inventory_object(old_item_id, cb); +} + +void FSFloaterLinkReplace::itemRemovedCallback(const LLUUID& outfit_folder_id) +{ + if (outfit_folder_id.notNull()) { - remove_inventory_object(old_item_id, LLPointer(NULL)); + LLAppearanceMgr::getInstance()->updateClothingOrderingInfo(outfit_folder_id); } if (mInstance) diff --git a/indra/newview/fsfloaterlinkreplace.h b/indra/newview/fsfloaterlinkreplace.h index 16f4f781a9..2b92b95ef1 100644 --- a/indra/newview/fsfloaterlinkreplace.h +++ b/indra/newview/fsfloaterlinkreplace.h @@ -35,6 +35,7 @@ class FSInventoryLinkReplaceDropTarget; class LLButton; class LLTextBox; +class LLInventoryCallback; class FSFloaterLinkReplace : public LLFloater, LLEventTimer { @@ -61,6 +62,7 @@ private: bool needs_wearable_ordering_update, bool needs_description_update, const LLUUID& outfit_folder_id); + void itemRemovedCallback(const LLUUID& outfit_folder_id); void onSourceItemDrop(const LLUUID& source_item_id); void onTargetItemDrop(const LLUUID& target_item_id);