summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-04-06 18:58:26 -0400
committerLoren Shih <seraph@lindenlab.com>2010-04-06 18:58:26 -0400
commitf096f02278f3b8c8fdd962c85b237492defa93ec (patch)
treea1016d9087ba0bad73895dee4280a195a0c01f0e /indra/newview
parentc3d9316dff568d5265d856a708e3909deae09f18 (diff)
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.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llagentwearables.cpp4
-rw-r--r--indra/newview/llagentwearablesfetch.cpp18
-rw-r--r--indra/newview/llappearancemgr.h4
-rw-r--r--indra/newview/llfloatergesture.cpp4
-rw-r--r--indra/newview/llfloaterproperties.cpp6
-rw-r--r--indra/newview/llfriendcard.cpp2
-rw-r--r--indra/newview/llgesturemgr.cpp4
-rw-r--r--indra/newview/llinventorybridge.cpp14
-rw-r--r--indra/newview/llinventoryobserver.cpp95
-rw-r--r--indra/newview/llinventoryobserver.h69
-rw-r--r--indra/newview/llinventorypanel.cpp2
-rw-r--r--indra/newview/llpaneloutfitedit.cpp4
-rw-r--r--indra/newview/llpreview.cpp2
-rw-r--r--indra/newview/llpreviewgesture.cpp4
-rw-r--r--indra/newview/llpreviewscript.cpp2
-rw-r--r--indra/newview/llsidepanelappearance.cpp2
-rw-r--r--indra/newview/llsidepaneliteminfo.cpp6
-rw-r--r--indra/newview/llstartup.cpp2
-rw-r--r--indra/newview/lltooldraganddrop.cpp35
-rw-r--r--indra/newview/llviewerinventory.h2
-rw-r--r--indra/newview/llviewermessage.cpp8
21 files changed, 162 insertions, 127 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index aedea5660f..7f248eee30 100644
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -952,7 +952,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
// Get the complete information on the items in the inventory and set up an observer
// that will trigger when the complete information is fetched.
outfit->startFetch();
- if(outfit->isEverythingComplete())
+ if(outfit->isFinished())
{
// everything is already here - call done.
outfit->done();
@@ -2066,7 +2066,7 @@ void LLAgentWearables::populateMyOutfitsFolder(void)
// setup an observer that will wait for that to happen.
gInventory.addObserver(outfits);
outfits->startFetch();
- if (outfits->isEverythingComplete())
+ if (outfits->isFinished())
{
outfits->done();
}
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();
}
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 27a4ffd8cb..93b3cecb6f 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -311,7 +311,7 @@ public:
// do the fetch
CallAfterCategoryFetchStage2<T> *stage2 = new CallAfterCategoryFetchStage2<T>(ids, mCallable);
stage2->startFetch();
- if(stage2->isEverythingComplete())
+ if(stage2->isFinished())
{
// everything is already here - call done.
stage2->done();
@@ -333,7 +333,7 @@ void callAfterCategoryFetch(const LLUUID& cat_id, T callable)
{
CallAfterCategoryFetchStage1<T> *stage1 = new CallAfterCategoryFetchStage1<T>(cat_id, callable);
stage1->startFetch();
- if (stage1->isEverythingComplete())
+ if (stage1->isFinished())
{
stage1->done();
}
diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp
index 04fb6bca3c..eff7131145 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;
- setFolders(unloaded_folders);
+ setFetchIDs(unloaded_folders);
startFetch();
}
else
@@ -203,7 +203,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);
- setFolders(folders);
+ setFetchIDs(folders);
startFetch();
if (mGestureList)
diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp
index bb9d151cd2..30b654de24 100644
--- a/indra/newview/llfloaterproperties.cpp
+++ b/indra/newview/llfloaterproperties.cpp
@@ -237,7 +237,7 @@ void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
// do not enable the UI for incomplete items.
LLViewerInventoryItem* i = (LLViewerInventoryItem*)item;
- BOOL is_complete = i->isComplete();
+ BOOL is_complete = i->isFinished();
const BOOL cannot_restrict_permissions = LLInventoryType::cannotRestrictPermissions(i->getInventoryType());
const BOOL is_calling_card = (i->getInventoryType() == LLInventoryType::IT_CALLINGCARD);
const LLPermissions& perm = item->getPermissions();
@@ -683,7 +683,7 @@ void LLFloaterProperties::onCommitPermissions()
CheckNextOwnerTransfer->get(), PERM_TRANSFER);
}
if(perm != item->getPermissions()
- && item->isComplete())
+ && item->isFinished())
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setPermissions(perm);
@@ -813,7 +813,7 @@ void LLFloaterProperties::updateSaleInfo()
sale_info.setSaleType(LLSaleInfo::FS_NOT);
}
if(sale_info != item->getSaleInfo()
- && item->isComplete())
+ && item->isFinished())
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp
index 945d2d26da..7f28e09933 100644
--- a/indra/newview/llfriendcard.cpp
+++ b/indra/newview/llfriendcard.cpp
@@ -413,7 +413,7 @@ void LLFriendCardsManager::fetchAndCheckFolderDescendents(const LLUUID& folder_i
// This instance will be deleted in LLInitialFriendCardsFetch::done().
LLInitialFriendCardsFetch* fetch = new LLInitialFriendCardsFetch(folder_id, cb);
fetch->startFetch();
- if(fetch->isEverythingComplete())
+ if(fetch->isFinished())
{
// everything is already here - call done.
fetch->done();
diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp
index 034806acfc..3d38ff3730 100644
--- a/indra/newview/llgesturemgr.cpp
+++ b/indra/newview/llgesturemgr.cpp
@@ -1031,9 +1031,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs,
else
{
// Watch this item and set gesture name when item exists in inventory
- uuid_vec_t ids;
- ids.push_back(item_id);
- self.setItems(ids);
+ self.setFetchID(item_id);
self.startFetch();
}
self.mActive[item_id] = gesture;
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 82043ab523..87b3c2e835 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1133,7 +1133,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action)
void LLItemBridge::selectItem()
{
LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(getItem());
- if(item && !item->isComplete())
+ if(item && !item->isFinished())
{
item->fetchFromServer();
}
@@ -2037,7 +2037,7 @@ void LLRightClickInventoryFetchDescendentsObserver::done()
outfit->startFetch();
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())
+/* if(outfit->isFinished())
{
// everything is already here - call done.
outfit->done();
@@ -2734,7 +2734,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)
LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE);
fetch->startFetch();
inc_busy_count();
- if(fetch->isEverythingComplete())
+ if(fetch->isFinished())
{
// everything is already here - call done.
fetch->done();
@@ -3195,7 +3195,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item,
else if(LLToolDragAndDrop::SOURCE_LIBRARY == source)
{
LLViewerInventoryItem* item = (LLViewerInventoryItem*)inv_item;
- if(item && item->isComplete())
+ if(item && item->isFinished())
{
accept = TRUE;
if(drop)
@@ -4054,7 +4054,7 @@ void LLObjectBridge::performAction(LLInventoryModel* model, std::string action)
{
rez_attachment(item, NULL);
}
- else if(item && item->isComplete())
+ else if(item && item->isFinished())
{
// must be in library. copy it to our inventory and put it on.
LLPointer<LLInventoryCallback> cb = new RezAttachmentCallback(0);
@@ -4687,7 +4687,7 @@ BOOL LLWearableBridge::canWearOnAvatar(void* user_data)
if(!self->isAgentInventory())
{
LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem();
- if(!item || !item->isComplete()) return FALSE;
+ if(!item || !item->isFinished()) return FALSE;
}
return (!get_is_item_worn(self->mUUID));
}
@@ -5307,7 +5307,7 @@ public:
// must be in the inventory library. copy it to our inventory
// and put it on right away.
LLViewerInventoryItem* item = getItem();
- if(item && item->isComplete())
+ if(item && item->isFinished())
{
LLPointer<LLInventoryCallback> cb = new WearOnAvatarCallback();
copy_inventory_item(
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index fecd18b4bb..ab32db9c8e 100644
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -71,6 +71,36 @@ LLInventoryObserver::~LLInventoryObserver()
{
}
+LLInventoryFetchObserver::LLInventoryFetchObserver(const LLUUID& id)
+{
+ mIDs.clear();
+ if (id != LLUUID::null)
+ {
+ setFetchID(id);
+ }
+}
+
+LLInventoryFetchObserver::LLInventoryFetchObserver(const uuid_vec_t& ids)
+{
+ setFetchIDs(ids);
+}
+
+BOOL LLInventoryFetchObserver::isFinished() const
+{
+ return mIncomplete.empty();
+}
+
+void LLInventoryFetchObserver::setFetchIDs(const uuid_vec_t& ids)
+{
+ mIDs = ids;
+}
+void LLInventoryFetchObserver::setFetchID(const LLUUID& id)
+{
+ mIDs.clear();
+ mIDs.push_back(id);
+}
+
+
void LLInventoryCompletionObserver::changed(U32 mask)
{
// scan through the incomplete items and move or erase them as
@@ -79,13 +109,13 @@ void LLInventoryCompletionObserver::changed(U32 mask)
{
for(uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); )
{
- LLViewerInventoryItem* item = gInventory.getItem(*it);
+ const LLViewerInventoryItem* item = gInventory.getItem(*it);
if(!item)
{
it = mIncomplete.erase(it);
continue;
}
- if(item->isComplete())
+ if(item->isFinished())
{
mComplete.push_back(*it);
it = mIncomplete.erase(it);
@@ -108,13 +138,16 @@ void LLInventoryCompletionObserver::watchItem(const LLUUID& id)
}
}
-LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(bool retry_if_missing) :
+/*
+LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(BOOL retry_if_missing) :
mRetryIfMissing(retry_if_missing)
{
}
+*/
LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const LLUUID& item_id,
- bool retry_if_missing) :
+ BOOL retry_if_missing) :
+ LLInventoryFetchObserver(item_id),
mRetryIfMissing(retry_if_missing)
{
mIDs.clear();
@@ -122,8 +155,8 @@ LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const LLUUID& item_
}
LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids,
- bool retry_if_missing) :
- mIDs(item_ids),
+ BOOL retry_if_missing) :
+ LLInventoryFetchObserver(item_ids),
mRetryIfMissing(retry_if_missing)
{
}
@@ -155,7 +188,7 @@ void LLInventoryFetchItemsObserver::changed(U32 mask)
}
continue;
}
- if(item->isComplete())
+ if(item->isFinished())
{
mComplete.push_back(*it);
it = mIncomplete.erase(it);
@@ -172,9 +205,8 @@ void LLInventoryFetchItemsObserver::changed(U32 mask)
//llinfos << "LLInventoryFetchItemsObserver::changed() mIncomplete size " << mIncomplete.size() << llendl;
}
-bool LLInventoryFetchItemsObserver::isEverythingComplete() const
+void LLInventoryFetchItemsObserver::done()
{
- return mIncomplete.empty();
}
void fetch_items_from_llsd(const LLSD& items_llsd)
@@ -247,7 +279,7 @@ void LLInventoryFetchItemsObserver::startFetch()
LLViewerInventoryItem* item = gInventory.getItem(*it);
if(item)
{
- if(item->isComplete())
+ if(item->isFinished())
{
// It's complete, so put it on the complete container.
mComplete.push_back(*it);
@@ -277,32 +309,28 @@ void LLInventoryFetchItemsObserver::startFetch()
fetch_items_from_llsd(items_llsd);
}
-LLInventoryFetchDescendentsObserver::LLInventoryFetchDescendentsObserver()
-{
-}
-
-LLInventoryFetchDescendentsObserver::LLInventoryFetchDescendentsObserver(const LLUUID& cat_id)
+LLInventoryFetchDescendentsObserver::LLInventoryFetchDescendentsObserver(const LLUUID& cat_id) :
+ LLInventoryFetchObserver(cat_id)
{
- mIDs.clear();
- mIDs.push_back(cat_id);
}
LLInventoryFetchDescendentsObserver::LLInventoryFetchDescendentsObserver(const uuid_vec_t& cat_ids) :
- mIDs(cat_ids)
+ LLInventoryFetchObserver(cat_ids)
{
}
+
// virtual
void LLInventoryFetchDescendentsObserver::changed(U32 mask)
{
for(uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end();)
{
- LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
+ const LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
if(!cat)
{
it = mIncomplete.erase(it);
continue;
}
- if(isComplete(cat))
+ if(isCategoryComplete(cat))
{
mComplete.push_back(*it);
it = mIncomplete.erase(it);
@@ -322,7 +350,7 @@ void LLInventoryFetchDescendentsObserver::startFetch()
{
LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
if(!cat) continue;
- if(!isComplete(cat))
+ if(!isCategoryComplete(cat))
{
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.
@@ -334,19 +362,14 @@ void LLInventoryFetchDescendentsObserver::startFetch()
}
}
-bool LLInventoryFetchDescendentsObserver::isEverythingComplete() const
-{
- return mIncomplete.empty();
-}
-
-bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory* cat)
+BOOL LLInventoryFetchDescendentsObserver::isCategoryComplete(const LLViewerInventoryCategory* cat) const
{
const S32 version = cat->getVersion();
const S32 expected_num_descendents = cat->getDescendentCount();
if ((version == LLViewerInventoryCategory::VERSION_UNKNOWN) ||
(expected_num_descendents == LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN))
{
- return false;
+ return FALSE;
}
// it might be complete - check known descendents against
// currently available.
@@ -360,14 +383,14 @@ bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory*
// that the cat just doesn't have any items or subfolders).
// Unrecoverable, so just return done so that this observer can be cleared
// from memory.
- return true;
+ return TRUE;
}
const S32 current_num_known_descendents = cats->count() + items->count();
// Got the number of descendents that we were expecting, so we're done.
if (current_num_known_descendents == expected_num_descendents)
{
- return true;
+ return TRUE;
}
// Error condition, but recoverable. This happens if something was added to the
@@ -376,10 +399,10 @@ bool LLInventoryFetchDescendentsObserver::isComplete(LLViewerInventoryCategory*
if (current_num_known_descendents >= expected_num_descendents)
{
llwarns << "Category '" << cat->getName() << "' expected descendentcount:" << expected_num_descendents << " descendents but got descendentcount:" << current_num_known_descendents << llendl;
- cat->setDescendentCount(current_num_known_descendents);
- return true;
+ const_cast<LLViewerInventoryCategory *>(cat)->setDescendentCount(current_num_known_descendents);
+ return TRUE;
}
- return false;
+ return FALSE;
}
void LLInventoryFetchComboObserver::changed(U32 mask)
@@ -394,7 +417,7 @@ void LLInventoryFetchComboObserver::changed(U32 mask)
it = mIncompleteItems.erase(it);
continue;
}
- if(item->isComplete())
+ if(item->isFinished())
{
mCompleteItems.push_back(*it);
it = mIncompleteItems.erase(it);
@@ -424,7 +447,7 @@ void LLInventoryFetchComboObserver::changed(U32 mask)
}
if(!mDone && mIncompleteItems.empty() && mIncompleteFolders.empty())
{
- mDone = true;
+ mDone = TRUE;
done();
}
}
@@ -464,7 +487,7 @@ void LLInventoryFetchComboObserver::startFetch(const uuid_vec_t& folder_ids,
lldebugs << "uanble to find item " << *iit << llendl;
continue;
}
- if(item->isComplete())
+ if(item->isFinished())
{
// It's complete, so put it on the complete container.
mCompleteItems.push_back(*iit);
diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h
index 420afdfadc..7480b7e7af 100644
--- a/indra/newview/llinventoryobserver.h
+++ b/indra/newview/llinventoryobserver.h
@@ -73,57 +73,70 @@ public:
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Class LLInventoryFetchItemsObserver
+// Class LLInventoryFetchObserver
//
-// Fetches inventory items, calls done() when all inventory has arrived.
+// Abstract class to handle fetching items, folders, etc.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-class LLInventoryFetchItemsObserver : public LLInventoryObserver
+class LLInventoryFetchObserver : public LLInventoryObserver
{
public:
- LLInventoryFetchItemsObserver(bool retry_if_missing = false); // deprecated
- LLInventoryFetchItemsObserver(const LLUUID& item_id, bool retry_if_missing = false); // single item
- LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids, bool retry_if_missing = false); // multiple items
- virtual void changed(U32 mask);
+ LLInventoryFetchObserver(const LLUUID& id = LLUUID::null); // single item
+ LLInventoryFetchObserver(const uuid_vec_t& ids); // multiple items
+ void setFetchID(const LLUUID& id);
+ void setFetchIDs(const uuid_vec_t& ids);
- bool isEverythingComplete() const;
- void setItems(const uuid_vec_t& ids) { mIDs = ids; }
- void startFetch();
+ BOOL isFinished() const;
- virtual void done() {};
+ virtual void startFetch() = 0;
+ virtual void done() = 0;
+ virtual void changed(U32 mask) = 0;
protected:
- bool mRetryIfMissing;
uuid_vec_t mComplete;
uuid_vec_t mIncomplete;
uuid_vec_t mIDs;
};
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+// Class LLInventoryFetchItemsObserver
+//
+// Fetches inventory items, calls done() when all inventory has arrived.
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+class LLInventoryFetchItemsObserver : public LLInventoryFetchObserver
+{
+public:
+ // LLInventoryFetchItemsObserver(BOOL retry_if_missing = FALSE);
+ LLInventoryFetchItemsObserver(const LLUUID& item_id = LLUUID::null,
+ BOOL retry_if_missing = FALSE);
+ LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids,
+ BOOL retry_if_missing = FALSE);
+
+ /*virtual*/ void startFetch();
+ /*virtual*/ void changed(U32 mask);
+ /*virtual*/ void done();
+
+protected:
+ BOOL mRetryIfMissing;
+};
+
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLInventoryFetchDescendentsObserver
//
// Fetches children of a category/folder, calls done() when all
// inventory has arrived.
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-class LLInventoryFetchDescendentsObserver : public LLInventoryObserver
+class LLInventoryFetchDescendentsObserver : public LLInventoryFetchObserver
{
public:
- LLInventoryFetchDescendentsObserver();
- LLInventoryFetchDescendentsObserver(const LLUUID& cat_id);
+ // LLInventoryFetchDescendentsObserver();
+ LLInventoryFetchDescendentsObserver(const LLUUID& cat_id = LLUUID::null);
LLInventoryFetchDescendentsObserver(const uuid_vec_t& cat_ids);
- virtual void changed(U32 mask);
-
- void setFolders(const uuid_vec_t& cat_ids) { mIDs = cat_ids; }
- void setFolders(const LLUUID& cat_id) { mIDs.clear(); mIDs.push_back(cat_id); }
- void startFetch();
- bool isEverythingComplete() const;
- virtual void done() = 0;
+ /*virtual*/ void startFetch();
+ /*virtual*/ void changed(U32 mask);
protected:
- bool isComplete(LLViewerInventoryCategory* cat);
- uuid_vec_t mIncomplete;
- uuid_vec_t mComplete;
- uuid_vec_t mIDs;
+ BOOL isCategoryComplete(const LLViewerInventoryCategory* cat) const;
};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -137,7 +150,7 @@ protected:
class LLInventoryFetchComboObserver : public LLInventoryObserver
{
public:
- LLInventoryFetchComboObserver() : mDone(false) {}
+ LLInventoryFetchComboObserver() : mDone(FALSE) {}
virtual void changed(U32 mask);
void startFetch(const uuid_vec_t& folder_ids, const uuid_vec_t& item_ids);
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index c6c2d23a4b..f3ad4b6890 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -901,7 +901,7 @@ bool LLInventoryPanel::attachObject(const LLSD& userdata)
{
rez_attachment(item, attachmentp);
}
- else if(item && item->isComplete())
+ else if(item && item->isFinished())
{
// must be in library. copy it to our inventory and put it on.
LLPointer<LLInventoryCallback> cb = new RezAttachmentCallback(attachmentp);
diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp
index e93293a0f0..270999e560 100644
--- a/indra/newview/llpaneloutfitedit.cpp
+++ b/indra/newview/llpaneloutfitedit.cpp
@@ -482,9 +482,9 @@ void LLPanelOutfitEdit::updateLookInfo()
{
mLookContents->clearRows();
- mFetchLook->setFolders(mLookID);
+ mFetchLook->setFetchID(mLookID);
mFetchLook->startFetch();
- if (mFetchLook->isEverythingComplete())
+ if (mFetchLook->isFinished())
{
mFetchLook->done();
}
diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp
index d0db77dcbe..dd31a62642 100644
--- a/indra/newview/llpreview.cpp
+++ b/indra/newview/llpreview.cpp
@@ -138,7 +138,7 @@ void LLPreview::onCommit()
const LLViewerInventoryItem *item = dynamic_cast<const LLViewerInventoryItem*>(getItem());
if(item)
{
- if (!item->isComplete())
+ if (!item->isFinished())
{
// We are attempting to save an item that was never loaded
llwarns << "LLPreview::onCommit() called with mIsComplete == FALSE"
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index fce90e4c44..2e061b235d 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -141,7 +141,7 @@ LLPreviewGesture* LLPreviewGesture::show(const LLUUID& item_id, const LLUUID& ob
// this will call refresh when we have everything.
LLViewerInventoryItem* item = (LLViewerInventoryItem*)preview->getItem();
- if (item && !item->isComplete())
+ if (item && !item->isFinished())
{
LLInventoryGestureAvailable* observer;
observer = new LLInventoryGestureAvailable();
@@ -648,7 +648,7 @@ void LLPreviewGesture::refresh()
LLPreview::refresh();
// If previewing or item is incomplete, all controls are disabled
LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem();
- bool is_complete = (item && item->isComplete()) ? true : false;
+ bool is_complete = (item && item->isFinished()) ? true : false;
if (mPreviewGesture || !is_complete)
{
diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp
index 6b0e524f8c..7b926f468d 100644
--- a/indra/newview/llpreviewscript.cpp
+++ b/indra/newview/llpreviewscript.cpp
@@ -1823,7 +1823,7 @@ void LLLiveLSLEditor::saveIfNeeded()
return;
}
- if(mItem.isNull() || !mItem->isComplete())
+ if(mItem.isNull() || !mItem->isFinished())
{
// $NOTE: While the error message may not be exactly correct,
// it's pretty close.
diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp
index 6dd4dc1ce7..88043365db 100644
--- a/indra/newview/llsidepanelappearance.cpp
+++ b/indra/newview/llsidepanelappearance.cpp
@@ -396,7 +396,7 @@ void LLSidepanelAppearance::fetchInventory()
fetch_worn->startFetch();
// If no items to be fetched, done will never be triggered.
// TODO: Change LLInventoryFetchItemsObserver::fetchItems to trigger done() on this condition.
- if (fetch_worn->isEverythingComplete())
+ if (fetch_worn->isFinished())
{
fetch_worn->done();
}
diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp
index 9b073943b4..0ec351965a 100644
--- a/indra/newview/llsidepaneliteminfo.cpp
+++ b/indra/newview/llsidepaneliteminfo.cpp
@@ -236,7 +236,7 @@ void LLSidepanelItemInfo::refreshFromItem(LLViewerInventoryItem* item)
if (!item) return;
// do not enable the UI for incomplete items.
- BOOL is_complete = item->isComplete();
+ BOOL is_complete = item->isFinished();
const BOOL cannot_restrict_permissions = LLInventoryType::cannotRestrictPermissions(item->getInventoryType());
const BOOL is_calling_card = (item->getInventoryType() == LLInventoryType::IT_CALLINGCARD);
const LLPermissions& perm = item->getPermissions();
@@ -743,7 +743,7 @@ void LLSidepanelItemInfo::onCommitPermissions()
CheckNextOwnerTransfer->get(), PERM_TRANSFER);
}
if(perm != item->getPermissions()
- && item->isComplete())
+ && item->isFinished())
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
new_item->setPermissions(perm);
@@ -873,7 +873,7 @@ void LLSidepanelItemInfo::updateSaleInfo()
sale_info.setSaleType(LLSaleInfo::FS_NOT);
}
if(sale_info != item->getSaleInfo()
- && item->isComplete())
+ && item->isFinished())
{
LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item);
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 340327a1e2..83a97c1ab1 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().setItems(item_ids);
+ LLGestureMgr::instance().setFetchIDs(item_ids);
LLGestureMgr::instance().startFetch();
}
}
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index cc90b0753f..8f2e82914a 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -287,7 +287,7 @@ void LLCategoryDropObserver::done()
}
delete this;
}
-
+/* Doesn't seem to be used anymore.
class LLCategoryDropDescendentsObserver : public LLInventoryFetchDescendentsObserver
{
public:
@@ -335,7 +335,7 @@ void LLCategoryDropDescendentsObserver::done()
LLCategoryDropObserver* dropper;
dropper = new LLCategoryDropObserver(ids, mObjectID, mSource);
dropper->startFetch();
- if (dropper->isEverythingComplete())
+ if (dropper->isDone())
{
dropper->done();
}
@@ -346,6 +346,7 @@ void LLCategoryDropDescendentsObserver::done()
}
delete this;
}
+*/
LLToolDragAndDrop::DragAndDropEntry::DragAndDropEntry(dragOrDrop3dImpl f_none,
dragOrDrop3dImpl f_self,
@@ -1205,7 +1206,7 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target,
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return;
+ if (!item || !item->isFinished()) return;
//if (regionp
// && (regionp->getRegionFlags() & REGION_FLAGS_SANDBOX))
@@ -1836,7 +1837,7 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL
if (!item || !obj) return ACCEPT_NO;
// HACK: downcast
LLViewerInventoryItem* vitem = (LLViewerInventoryItem*)item;
- if (!vitem->isComplete()) return ACCEPT_NO;
+ if (!vitem->isFinished()) return ACCEPT_NO;
if (vitem->getIsLinkType()) return ACCEPT_NO; // No giving away links
// deny attempts to drop from an object onto itself. This is to
@@ -1996,7 +1997,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
// must not be in the trash
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
@@ -2045,7 +2046,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
if (!isAgentAvatarValid() || gAgentAvatarp->isWearingAttachment(item->getUUID()))
{
@@ -2107,7 +2108,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnObject(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
if (!isAgentAvatarValid() || gAgentAvatarp->isWearingAttachment(item->getUUID()))
{
return ACCEPT_NO;
@@ -2186,7 +2187,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezScript(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
EAcceptance rv = willObjectAcceptInventory(obj, item);
if (drop && (ACCEPT_YES_SINGLE <= rv))
{
@@ -2224,7 +2225,7 @@ EAcceptance LLToolDragAndDrop::dad3dTextureObject(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
EAcceptance rv = willObjectAcceptInventory(obj, item);
if ((mask & MASK_CONTROL))
{
@@ -2289,7 +2290,7 @@ EAcceptance LLToolDragAndDrop::dad3dWearItem(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
if (mSource == SOURCE_AGENT || mSource == SOURCE_LIBRARY)
{
@@ -2344,7 +2345,7 @@ EAcceptance LLToolDragAndDrop::dad3dActivateGesture(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
if (mSource == SOURCE_AGENT || mSource == SOURCE_LIBRARY)
{
@@ -2452,7 +2453,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventory(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
LLViewerObject* root_object = obj;
if (obj && obj->getParent())
{
@@ -2580,7 +2581,7 @@ EAcceptance LLToolDragAndDrop::dad3dUpdateInventoryCategory(
}
LLCategoryDropObserver* dropper = new LLCategoryDropObserver(ids, obj->getID(), mSource);
dropper->startFetch();
- if (dropper->isEverythingComplete())
+ if (dropper->isFinished())
{
dropper->done();
}
@@ -2611,7 +2612,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventoryObject(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
if (!item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()))
{
// cannot give away no-transfer objects
@@ -2645,7 +2646,7 @@ EAcceptance LLToolDragAndDrop::dad3dGiveInventory(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
if (!isInventoryGiveAcceptable(item))
{
return ACCEPT_NO;
@@ -2684,7 +2685,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnLand(
LLViewerInventoryItem* item = NULL;
LLViewerInventoryCategory* cat = NULL;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
if (!gAgent.allowOperation(PERM_COPY, item->getPermissions())
|| !item->getPermissions().allowTransferTo(LLUUID::null))
@@ -2705,7 +2706,7 @@ EAcceptance LLToolDragAndDrop::dad3dRezFromObjectOnObject(
LLViewerInventoryItem* item;
LLViewerInventoryCategory* cat;
locateInventory(item, cat);
- if (!item || !item->isComplete()) return ACCEPT_NO;
+ if (!item || !item->isFinished()) return ACCEPT_NO;
if ((mask & MASK_CONTROL))
{
// *HACK: In order to resolve SL-22177, we need to block drags
diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h
index 2db88c2ff8..9d449399e8 100644
--- a/indra/newview/llviewerinventory.h
+++ b/indra/newview/llviewerinventory.h
@@ -138,7 +138,7 @@ public:
bool importFileLocal(LLFILE* fp);
// new methods
- BOOL isComplete() const { return mIsComplete; }
+ BOOL isFinished() const { return mIsComplete; }
void setComplete(BOOL complete) { mIsComplete = complete; }
//void updateAssetOnServer() const;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 35eb3390a5..e800611914 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -1209,7 +1209,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
// so we can fetch it out of our inventory.
LLOpenAgentOffer* open_agent_offer = new LLOpenAgentOffer(mObjectID, from_string);
open_agent_offer->startFetch();
- if(catp || (itemp && itemp->isComplete()))
+ if(catp || (itemp && itemp->isFinished()))
{
open_agent_offer->done();
}
@@ -1272,7 +1272,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
LLDiscardAgentOffer* discard_agent_offer;
discard_agent_offer = new LLDiscardAgentOffer(mFolderID, mObjectID);
discard_agent_offer->startFetch(folders, items);
- if(catp || (itemp && itemp->isComplete()))
+ if(catp || (itemp && itemp->isFinished()))
{
discard_agent_offer->done();
}
@@ -1605,7 +1605,7 @@ void inventory_offer_handler(LLOfferInfo* info)
// Prefetch the item into your local inventory.
LLInventoryFetchItemsObserver* fetch_item = new LLInventoryFetchItemsObserver(info->mObjectID);
fetch_item->startFetch();
- if(fetch_item->isEverythingComplete())
+ if(fetch_item->isFinished())
{
fetch_item->done();
}
@@ -2927,7 +2927,7 @@ BOOL LLPostTeleportNotifiers::tick()
{
LLFetchInWelcomeArea* fetcher = new LLFetchInWelcomeArea(folders);
fetcher->startFetch();
- if(fetcher->isEverythingComplete())
+ if(fetcher->isFinished())
{
fetcher->done();
}