summaryrefslogtreecommitdiff
path: root/indra/newview/llagentwearablesfetch.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-04-06 14:47:20 -0400
committerLoren Shih <seraph@lindenlab.com>2010-04-06 14:47:20 -0400
commitcdbdb1168694bcbfc58208f2941f513b556a0d6e (patch)
tree3b024976b8254c11ecb2a11db8929ff035cff446 /indra/newview/llagentwearablesfetch.cpp
parentec5bd9c857b4d817685b09f9a10da7434ebbb816 (diff)
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.
Diffstat (limited to 'indra/newview/llagentwearablesfetch.cpp')
-rw-r--r--indra/newview/llagentwearablesfetch.cpp35
1 files changed, 18 insertions, 17 deletions
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<LLInventoryCallback> 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();