From cdbdb1168694bcbfc58208f2941f513b556a0d6e Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 6 Apr 2010 14:47:20 -0400 Subject: EXT-4151 : Immediately check if a fetchObserver filter is done, else add to observer list automatically FetchObservers now take in a list of IDs to check against. Made some naming changes. --- indra/newview/llagentwearablesfetch.cpp | 35 +++++++++++++++++---------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'indra/newview/llagentwearablesfetch.cpp') diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 3d6740f5a1..6b7edaa302 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -39,7 +39,8 @@ #include "llinventoryfunctions.h" #include "llvoavatarself.h" -LLInitialWearablesFetch::LLInitialWearablesFetch() +LLInitialWearablesFetch::LLInitialWearablesFetch(const uuid_vec_t& ids) : + LLInventoryFetchDescendentsObserver(ids) { } @@ -86,12 +87,11 @@ void LLInitialWearablesFetch::processContents() delete this; } -class LLFetchAndLinkObserver: public LLInventoryFetchObserver +class LLFetchAndLinkObserver: public LLInventoryFetchItemsObserver { public: LLFetchAndLinkObserver(uuid_vec_t& ids): - m_ids(ids), - LLInventoryFetchObserver(true) // retry for missing items + LLInventoryFetchItemsObserver(ids, true) // retry for missing items { } ~LLFetchAndLinkObserver() @@ -103,8 +103,8 @@ public: // Link to all fetched items in COF. LLPointer link_waiter = new LLUpdateAppearanceOnDestroy; - for (uuid_vec_t::iterator it = m_ids.begin(); - it != m_ids.end(); + for (uuid_vec_t::iterator it = mIDs.begin(); + it != mIDs.end(); ++it) { LLUUID id = *it; @@ -123,8 +123,6 @@ public: link_waiter); } } -private: - uuid_vec_t m_ids; }; void LLInitialWearablesFetch::processWearablesMessage() @@ -173,9 +171,9 @@ void LLInitialWearablesFetch::processWearablesMessage() // Need to fetch the inventory items for ids, then create links to them after they arrive. LLFetchAndLinkObserver *fetcher = new LLFetchAndLinkObserver(ids); - fetcher->fetch(ids); + fetcher->startFetch(); // If no items to be fetched, done will never be triggered. - // TODO: Change LLInventoryFetchObserver::fetchItems to trigger done() on this condition. + // TODO: Change LLInventoryFetchItemsObserver::fetchItems to trigger done() on this condition. if (fetcher->isEverythingComplete()) { fetcher->done(); @@ -191,7 +189,8 @@ void LLInitialWearablesFetch::processWearablesMessage() } } -LLLibraryOutfitsFetch::LLLibraryOutfitsFetch() : +LLLibraryOutfitsFetch::LLLibraryOutfitsFetch(const uuid_vec_t& ids) : + LLInventoryFetchDescendentsObserver(ids), mCurrFetchStep(LOFS_FOLDER), mOutfitsPopulated(false) { @@ -288,7 +287,8 @@ void LLLibraryOutfitsFetch::folderDone() uuid_vec_t folders; folders.push_back(mClothingID); folders.push_back(mLibraryClothingID); - fetch(folders); + setFolders(folders); + startFetch(); if (isEverythingComplete()) { done(); @@ -337,8 +337,8 @@ void LLLibraryOutfitsFetch::outfitsDone() } mComplete.clear(); - - fetch(folders); + setFolders(folders); + startFetch(); if (isEverythingComplete()) { done(); @@ -434,8 +434,8 @@ void LLLibraryOutfitsFetch::importedFolderFetch() folders.push_back(mImportedClothingID); mComplete.clear(); - - fetch(folders); + setFolders(folders); + startFetch(); if (isEverythingComplete()) { done(); @@ -464,7 +464,8 @@ void LLLibraryOutfitsFetch::importedFolderDone() } mComplete.clear(); - fetch(folders); + setFolders(folders); + startFetch(); if (isEverythingComplete()) { done(); -- cgit v1.2.3 From c3d9316dff568d5265d856a708e3909deae09f18 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 6 Apr 2010 17:30:23 -0400 Subject: EXT-6727 : Allow LLInventoryObservers to target a single item (instead of a vector of items) Added new constructors to LLInventoryFetch types to allow passing in a single item. --- indra/newview/llagentwearablesfetch.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llagentwearablesfetch.cpp') diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 6b7edaa302..04a970b683 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -39,8 +39,8 @@ #include "llinventoryfunctions.h" #include "llvoavatarself.h" -LLInitialWearablesFetch::LLInitialWearablesFetch(const uuid_vec_t& ids) : - LLInventoryFetchDescendentsObserver(ids) +LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) : + LLInventoryFetchDescendentsObserver(cof_id) { } @@ -189,8 +189,8 @@ void LLInitialWearablesFetch::processWearablesMessage() } } -LLLibraryOutfitsFetch::LLLibraryOutfitsFetch(const uuid_vec_t& ids) : - LLInventoryFetchDescendentsObserver(ids), +LLLibraryOutfitsFetch::LLLibraryOutfitsFetch(const LLUUID& my_outfits_id) : + LLInventoryFetchDescendentsObserver(my_outfits_id), mCurrFetchStep(LOFS_FOLDER), mOutfitsPopulated(false) { -- cgit v1.2.3 From f096f02278f3b8c8fdd962c85b237492defa93ec Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 6 Apr 2010 18:58:26 -0400 Subject: EXT-6728 : Have LLInventoryFetchItems/DescendentsObserver inherit from a base abstract LLInventoryFetchObserver class Added a new abstract class LLInventoryFetchObserver from which LLInventoryFetchItems and LLInventoryFetchDescendents inherit. Also changed isEverythingComplete to isFinished and made some other minor superficial changes. --- indra/newview/llagentwearablesfetch.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/newview/llagentwearablesfetch.cpp') diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 04a970b683..aafbb0d22c 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -174,7 +174,7 @@ void LLInitialWearablesFetch::processWearablesMessage() fetcher->startFetch(); // If no items to be fetched, done will never be triggered. // TODO: Change LLInventoryFetchItemsObserver::fetchItems to trigger done() on this condition. - if (fetcher->isEverythingComplete()) + if (fetcher->isFinished()) { fetcher->done(); } @@ -287,9 +287,9 @@ void LLLibraryOutfitsFetch::folderDone() uuid_vec_t folders; folders.push_back(mClothingID); folders.push_back(mLibraryClothingID); - setFolders(folders); + setFetchIDs(folders); startFetch(); - if (isEverythingComplete()) + if (isFinished()) { done(); } @@ -337,9 +337,9 @@ void LLLibraryOutfitsFetch::outfitsDone() } mComplete.clear(); - setFolders(folders); + setFetchIDs(folders); startFetch(); - if (isEverythingComplete()) + if (isFinished()) { done(); } @@ -434,9 +434,9 @@ void LLLibraryOutfitsFetch::importedFolderFetch() folders.push_back(mImportedClothingID); mComplete.clear(); - setFolders(folders); + setFetchIDs(folders); startFetch(); - if (isEverythingComplete()) + if (isFinished()) { done(); } @@ -464,9 +464,9 @@ void LLLibraryOutfitsFetch::importedFolderDone() } mComplete.clear(); - setFolders(folders); + setFetchIDs(folders); startFetch(); - if (isEverythingComplete()) + if (isFinished()) { done(); } -- cgit v1.2.3 From 516ec63f52245a777725d29efe3c35e4e4e72936 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 7 Apr 2010 14:40:36 -0400 Subject: EXT-6749 : Have all observers persist/retry when items are missing after notifications Added mNumTries and took out mRetryIfMissing --- indra/newview/llagentwearablesfetch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llagentwearablesfetch.cpp') diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index aafbb0d22c..08d8ccfd23 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -91,7 +91,7 @@ class LLFetchAndLinkObserver: public LLInventoryFetchItemsObserver { public: LLFetchAndLinkObserver(uuid_vec_t& ids): - LLInventoryFetchItemsObserver(ids, true) // retry for missing items + LLInventoryFetchItemsObserver(ids) { } ~LLFetchAndLinkObserver() -- cgit v1.2.3