diff options
author | Loren Shih <seraph@lindenlab.com> | 2010-04-06 10:19:15 -0400 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2010-04-06 10:19:15 -0400 |
commit | 785d4c34b62b7ca76b292e0001c516ba8fa738bc (patch) | |
tree | 2aa2b03daa6aa399bf77cfc36fd525ff1c6d7a45 | |
parent | 7bfa3e81e726569519e3f214c5091bf65516b7f5 (diff) |
EXT-4151 : Immediately check if a fetchObserver filter is done, else add to observer list automatically
Preliminary work to clean up naming conventions.
-rw-r--r-- | indra/newview/llagentwearables.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llagentwearablesfetch.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llappearancemgr.h | 8 | ||||
-rw-r--r-- | indra/newview/llfloatergesture.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llfriendcard.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llgesturemgr.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 10 | ||||
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llinventorymodelbackgroundfetch.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llinventoryobserver.cpp | 26 | ||||
-rw-r--r-- | indra/newview/llinventoryobserver.h | 8 | ||||
-rw-r--r-- | indra/newview/llpaneloutfitedit.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llsidepanelappearance.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llstartup.cpp | 2 | ||||
-rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewerinventory.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 12 |
19 files changed, 59 insertions, 61 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 0542e73bfd..9d3b5763e8 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -954,7 +954,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs // that will trigger when the complete information is fetched. uuid_vec_t folders; folders.push_back(current_outfit_id); - outfit->fetchDescendents(folders); + outfit->fetch(folders); if(outfit->isEverythingComplete()) { // everything is already here - call done. @@ -2070,7 +2070,7 @@ void LLAgentWearables::populateMyOutfitsFolder(void) folders.push_back(outfits->mMyOutfitsID); gInventory.addObserver(outfits); - outfits->fetchDescendents(folders); + outfits->fetch(folders); if (outfits->isEverythingComplete()) { outfits->done(); diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 1f22ba040d..3d6740f5a1 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -69,7 +69,7 @@ void LLInitialWearablesFetch::processContents() LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; LLFindWearables is_wearable; - gInventory.collectDescendentsIf(mCompleteFolders.front(), cat_array, wearable_array, + gInventory.collectDescendentsIf(mComplete.front(), cat_array, wearable_array, LLInventoryModel::EXCLUDE_TRASH, is_wearable); LLAppearanceMgr::instance().setAttachmentInvLinkEnable(true); @@ -173,7 +173,7 @@ 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->fetchItems(ids); + fetcher->fetch(ids); // If no items to be fetched, done will never be triggered. // TODO: Change LLInventoryFetchObserver::fetchItems to trigger done() on this condition. if (fetcher->isEverythingComplete()) @@ -282,13 +282,13 @@ void LLLibraryOutfitsFetch::folderDone() mLibraryClothingID = cat->getUUID(); } - mCompleteFolders.clear(); + mComplete.clear(); // Get the complete information on the items in the inventory. uuid_vec_t folders; folders.push_back(mClothingID); folders.push_back(mLibraryClothingID); - fetchDescendents(folders); + fetch(folders); if (isEverythingComplete()) { done(); @@ -336,9 +336,9 @@ void LLLibraryOutfitsFetch::outfitsDone() mImportedClothingID = cat->getUUID(); } - mCompleteFolders.clear(); + mComplete.clear(); - fetchDescendents(folders); + fetch(folders); if (isEverythingComplete()) { done(); @@ -433,9 +433,9 @@ void LLLibraryOutfitsFetch::importedFolderFetch() uuid_vec_t folders; folders.push_back(mImportedClothingID); - mCompleteFolders.clear(); + mComplete.clear(); - fetchDescendents(folders); + fetch(folders); if (isEverythingComplete()) { done(); @@ -463,8 +463,8 @@ void LLLibraryOutfitsFetch::importedFolderDone() mImportedClothingFolders.push_back(cat->getUUID()); } - mCompleteFolders.clear(); - fetchDescendents(folders); + mComplete.clear(); + fetch(folders); if (isEverythingComplete()) { done(); diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 423d9bde69..40b8844731 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -282,14 +282,14 @@ public: // happen. LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; - gInventory.collectDescendents(mCompleteFolders.front(), + gInventory.collectDescendents(mComplete.front(), cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH); S32 count = item_array.count(); if(!count) { - llwarns << "Nothing fetched in category " << mCompleteFolders.front() + llwarns << "Nothing fetched in category " << mComplete.front() << llendl; //dec_busy_count(); gInventory.removeObserver(this); @@ -307,7 +307,7 @@ public: gInventory.removeObserver(this); // do the fetch - stage2->fetchItems(ids); + stage2->fetch(ids); if(stage2->isEverythingComplete()) { // everything is already here - call done. @@ -331,7 +331,7 @@ void callAfterCategoryFetch(const LLUUID& cat_id, T callable) CallAfterCategoryFetchStage1<T> *stage1 = new CallAfterCategoryFetchStage1<T>(callable); uuid_vec_t folders; folders.push_back(cat_id); - stage1->fetchDescendents(folders); + stage1->fetch(folders); if (stage1->isEverythingComplete()) { stage1->done(); diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 0aca12bc5e..8ee8d13a9c 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -148,7 +148,7 @@ void LLFloaterGesture::done() if (!unloaded_folders.empty()) { LL_DEBUGS("Gesture")<< "Fetching subdirectories....." << LL_ENDL; - fetchDescendents(unloaded_folders); + fetch(unloaded_folders); } else { @@ -202,7 +202,7 @@ BOOL LLFloaterGesture::postBuild() folders.push_back(mGestureFolderID); //perform loading Gesture directory anyway to make sure that all subdirectory are loaded too. See method done() for details. gInventory.addObserver(this); - fetchDescendents(folders); + fetch(folders); if (mGestureList) { diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index a848128d67..6f069cca17 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -413,7 +413,7 @@ void LLFriendCardsManager::fetchAndCheckFolderDescendents(const LLUUID& folder_i uuid_vec_t folders; folders.push_back(folder_id); - fetch->fetchDescendents(folders); + fetch->fetch(folders); if(fetch->isEverythingComplete()) { // everything is already here - call done. diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index c13ebba923..a4342a4bc9 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -1033,7 +1033,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs, // Watch this item and set gesture name when item exists in inventory uuid_vec_t ids; ids.push_back(item_id); - self.fetchItems(ids); + self.fetch(ids); } self.mActive[item_id] = gesture; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 09168b4f31..b552b5ac07 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1974,7 +1974,7 @@ void LLRightClickInventoryFetchDescendentsObserver::done() { // Avoid passing a NULL-ref as mCompleteFolders.front() down to // gInventory.collectDescendents() - if( mCompleteFolders.empty() ) + if( mComplete.empty() ) { llwarns << "LLRightClickInventoryFetchDescendentsObserver::done with empty mCompleteFolders" << llendl; dec_busy_count(); @@ -1988,7 +1988,7 @@ void LLRightClickInventoryFetchDescendentsObserver::done() // happen. LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; - gInventory.collectDescendents(mCompleteFolders.front(), + gInventory.collectDescendents(mComplete.front(), cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH); @@ -2007,7 +2007,7 @@ void LLRightClickInventoryFetchDescendentsObserver::done() #endif LLRightClickInventoryFetchObserver* outfit; - outfit = new LLRightClickInventoryFetchObserver(mCompleteFolders.front(), mCopyItems); + outfit = new LLRightClickInventoryFetchObserver(mComplete.front(), mCopyItems); uuid_vec_t ids; for(S32 i = 0; i < count; ++i) { @@ -2026,7 +2026,7 @@ void LLRightClickInventoryFetchDescendentsObserver::done() inc_busy_count(); // do the fetch - outfit->fetchItems(ids); + outfit->fetch(ids); outfit->done(); //Not interested in waiting and this will be right 99% of the time. //Uncomment the following code for laggy Inventory UI. /* if(outfit->isEverythingComplete()) @@ -2723,7 +2723,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { folders.push_back(category->getUUID()); } - fetch->fetchDescendents(folders); + fetch->fetch(folders); inc_busy_count(); if(fetch->isEverythingComplete()) { diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b6202c6a8c..e63da1ebb9 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1326,7 +1326,7 @@ bool LLInventoryModel::fetchDescendentsOf(const LLUUID& folder_id) //{ // known_descendents += items->count(); //} - return cat->fetchDescendents(); + return cat->fetch(); } void LLInventoryModel::cache( diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 72e5c0dd75..cfbc2c3e05 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -257,7 +257,7 @@ void LLInventoryModelBackgroundFetch::backgroundFetch() { // category exists but has no children yet, fetch the descendants // for now, just request every time and rely on retry timer to throttle - if (cat->fetchDescendents()) + if (cat->fetch()) { mFetchTimer.reset(); mTimelyFetchPending = TRUE; diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 128f16ecf5..83e1bbd5a0 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -223,8 +223,7 @@ void fetch_items_from_llsd(const LLSD& items_llsd) } } -void LLInventoryFetchObserver::fetchItems( - const uuid_vec_t& ids) +void LLInventoryFetchObserver::fetch(const uuid_vec_t& ids) { LLUUID owner_id; LLSD items_llsd; @@ -266,30 +265,29 @@ void LLInventoryFetchObserver::fetchItems( // virtual void LLInventoryFetchDescendentsObserver::changed(U32 mask) { - for(uuid_vec_t::iterator it = mIncompleteFolders.begin(); it < mIncompleteFolders.end();) + for(uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end();) { LLViewerInventoryCategory* cat = gInventory.getCategory(*it); if(!cat) { - it = mIncompleteFolders.erase(it); + it = mIncomplete.erase(it); continue; } if(isComplete(cat)) { - mCompleteFolders.push_back(*it); - it = mIncompleteFolders.erase(it); + mComplete.push_back(*it); + it = mIncomplete.erase(it); continue; } ++it; } - if(mIncompleteFolders.empty()) + if(mIncomplete.empty()) { done(); } } -void LLInventoryFetchDescendentsObserver::fetchDescendents( - const uuid_vec_t& ids) +void LLInventoryFetchDescendentsObserver::fetch(const uuid_vec_t& ids) { for(uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) { @@ -297,19 +295,19 @@ void LLInventoryFetchDescendentsObserver::fetchDescendents( if(!cat) continue; if(!isComplete(cat)) { - cat->fetchDescendents(); //blindly fetch it without seeing if anything else is fetching it. - mIncompleteFolders.push_back(*it); //Add to list of things being downloaded for this observer. + cat->fetch(); //blindly fetch it without seeing if anything else is fetching it. + mIncomplete.push_back(*it); //Add to list of things being downloaded for this observer. } else { - mCompleteFolders.push_back(*it); + mComplete.push_back(*it); } } } bool LLInventoryFetchDescendentsObserver::isEverythingComplete() const { - return mIncompleteFolders.empty(); + return mIncomplete.empty(); } bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* cat) @@ -413,7 +411,7 @@ void LLInventoryFetchComboObserver::fetch( if(!cat) continue; if(!gInventory.isCategoryComplete(*fit)) { - cat->fetchDescendents(); + cat->fetch(); lldebugs << "fetching folder " << *fit <<llendl; mIncompleteFolders.push_back(*fit); } diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index aaa21a9da8..ba70552ebc 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -112,7 +112,7 @@ public: virtual void changed(U32 mask); bool isEverythingComplete() const; - void fetchItems(const uuid_vec_t& ids); + void fetch(const uuid_vec_t& ids); virtual void done() {}; protected: @@ -134,14 +134,14 @@ public: LLInventoryFetchDescendentsObserver() {} virtual void changed(U32 mask); - void fetchDescendents(const uuid_vec_t& ids); + void fetch(const uuid_vec_t& ids); bool isEverythingComplete() const; virtual void done() = 0; protected: bool isComplete(LLViewerInventoryCategory* cat); - uuid_vec_t mIncompleteFolders; - uuid_vec_t mCompleteFolders; + uuid_vec_t mIncomplete; + uuid_vec_t mComplete; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index ba22adc01c..9e6a66c16b 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -480,7 +480,7 @@ void LLPanelOutfitEdit::updateLookInfo() uuid_vec_t folders; folders.push_back(mLookID); - mFetchLook->fetchDescendents(folders); + mFetchLook->fetch(folders); if (mFetchLook->isEverythingComplete()) { mFetchLook->done(); diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 89c60fed34..a11b0b44d5 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -389,7 +389,7 @@ void LLSidepanelAppearance::fetchInventory() } LLCurrentlyWornFetchObserver *fetch_worn = new LLCurrentlyWornFetchObserver(this); - fetch_worn->fetchItems(ids); + fetch_worn->fetch(ids); // If no items to be fetched, done will never be triggered. // TODO: Change LLInventoryFetchObserver::fetchItems to trigger done() on this condition. if (fetch_worn->isEverythingComplete()) diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 4f1bcde302..d7c8b5fcd4 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1771,7 +1771,7 @@ bool idle_startup() } } // no need to add gesture to inventory observer, it's already made in constructor - LLGestureMgr::instance().fetchItems(item_ids); + LLGestureMgr::instance().fetch(item_ids); } } gDisplaySwapBuffers = TRUE; diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index c977377f3a..1e81e675e6 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -306,8 +306,8 @@ void LLCategoryDropDescendentsObserver::done() { gInventory.removeObserver(this); - uuid_vec_t::iterator it = mCompleteFolders.begin(); - uuid_vec_t::iterator end = mCompleteFolders.end(); + uuid_vec_t::iterator it = mComplete.begin(); + uuid_vec_t::iterator end = mComplete.end(); LLViewerInventoryCategory::cat_array_t cats; LLViewerInventoryItem::item_array_t items; for(; it != end; ++it) @@ -332,7 +332,7 @@ void LLCategoryDropDescendentsObserver::done() std::copy(unique_ids.begin(), unique_ids.end(), copier); LLCategoryDropObserver* dropper; dropper = new LLCategoryDropObserver(mObjectID, mSource); - dropper->fetchItems(ids); + dropper->fetch(ids); if (dropper->isEverythingComplete()) { dropper->done(); @@ -2577,7 +2577,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory( ids.push_back(item->getUUID()); } LLCategoryDropObserver* dropper = new LLCategoryDropObserver(obj->getID(), mSource); - dropper->fetchItems(ids); + dropper->fetch(ids); if (dropper->isEverythingComplete()) { dropper->done(); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 353ffee66f..444d397146 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -519,7 +519,7 @@ void LLViewerInventoryCategory::removeFromServer( void ) gAgent.sendReliableMessage(); } -bool LLViewerInventoryCategory::fetchDescendents() +bool LLViewerInventoryCategory::fetch() { if((VERSION_UNKNOWN == mVersion) && mDescendentsRequested.hasExpired()) //Expired check prevents multiple downloads. diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 3577bd8791..2db88c2ff8 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -212,7 +212,7 @@ public: void setVersion(S32 version) { mVersion = version; } // Returns true if a fetch was issued. - bool fetchDescendents(); + bool fetch(); // used to help make cacheing more robust - for example, if // someone is getting 4 packets but logs out after 3. the viewer diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 24a6b12905..d91b6d0b1e 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -6158,7 +6158,7 @@ class LLAttachmentEnableDrop : public view_listener_t items.push_back((*attachment_iter)->getItemID()); - wornItemFetched->fetchItems(items); + wornItemFetched->fetch(items); gInventory.addObserver(wornItemFetched); } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 598e55e2c8..a471876ce1 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1207,7 +1207,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& uuid_vec_t items; items.push_back(mObjectID); LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(from_string); - open_agent_offer->fetchItems(items); + open_agent_offer->fetch(items); if(catp || (itemp && itemp->isComplete())) { open_agent_offer->done(); @@ -1605,7 +1605,7 @@ void inventory_offer_handler(LLOfferInfo* info) uuid_vec_t items; items.push_back(info->mObjectID); LLInventoryFetchObserver* fetch_item = new LLInventoryFetchObserver(); - fetch_item->fetchItems(items); + fetch_item->fetch(items); if(fetch_item->isEverythingComplete()) { fetch_item->done(); @@ -2124,7 +2124,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) uuid_vec_t items; items.push_back(info->mObjectID); LLInventoryFetchObserver* fetch_item = new LLInventoryFetchObserver(); - fetch_item->fetchItems(items); + fetch_item->fetch(items); delete fetch_item; // Same as closing window @@ -2855,8 +2855,8 @@ public: LLInventoryModel::cat_array_t land_cats; LLInventoryModel::item_array_t land_items; - uuid_vec_t::iterator it = mCompleteFolders.begin(); - uuid_vec_t::iterator end = mCompleteFolders.end(); + uuid_vec_t::iterator it = mComplete.begin(); + uuid_vec_t::iterator end = mComplete.end(); for(; it != end; ++it) { gInventory.collectDescendentsIf( @@ -2927,7 +2927,7 @@ BOOL LLPostTeleportNotifiers::tick() if(!folders.empty()) { LLFetchInWelcomeArea* fetcher = new LLFetchInWelcomeArea; - fetcher->fetchDescendents(folders); + fetcher->fetch(folders); if(fetcher->isEverythingComplete()) { fetcher->done(); |