diff options
author | Palmer Truelson <palmer@lindenlab.com> | 2009-12-22 14:06:48 -0600 |
---|---|---|
committer | Palmer Truelson <palmer@lindenlab.com> | 2009-12-22 14:06:48 -0600 |
commit | 616ca198143e7cc3f925add2c3b83aaf5d2fe244 (patch) | |
tree | a6f234275727009d196dbd6070753bcb02699bb0 /indra/newview/llinventorymodel.cpp | |
parent | 8f8e5c850a0574f30f9be1e3164531751139d2c5 (diff) | |
parent | e72a3c63ec44255172e253fe43e192918ec6117e (diff) |
Merge
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 55 |
1 files changed, 50 insertions, 5 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 96925490cf..1eb8d1bc2c 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1340,8 +1340,7 @@ bool LLInventoryModel::fetchDescendentsOf(const LLUUID& folder_id) //Initialize statics. bool LLInventoryModel::isBulkFetchProcessingComplete() { - return ( (sFetchQueue.empty() - && sBulkFetchCount<=0) ? TRUE : FALSE ) ; + return sFetchQueue.empty() && sBulkFetchCount<=0; } class LLInventoryModelFetchDescendentsResponder: public LLHTTPClient::Responder @@ -1616,10 +1615,58 @@ void LLInventoryModel::bulkFetch(std::string url) } } +bool fetchQueueContainsNoDescendentsOf(const LLUUID& cat_id) +{ + for (std::deque<LLUUID>::iterator it = sFetchQueue.begin(); + it != sFetchQueue.end(); ++it) + { + const LLUUID& fetch_id = *it; + if (gInventory.isObjectDescendentOf(fetch_id, cat_id)) + return false; + } + return true; +} + +/* static */ +bool LLInventoryModel::libraryFetchStarted() +{ + return sLibraryFetchStarted; +} + +/* static */ +bool LLInventoryModel::libraryFetchCompleted() +{ + return libraryFetchStarted() && fetchQueueContainsNoDescendentsOf(gInventory.getLibraryRootFolderID()); +} + +/* static */ +bool LLInventoryModel::libraryFetchInProgress() +{ + return libraryFetchStarted() && !libraryFetchCompleted(); +} + +/* static */ +bool LLInventoryModel::myInventoryFetchStarted() +{ + return sMyInventoryFetchStarted; +} + +/* static */ +bool LLInventoryModel::myInventoryFetchCompleted() +{ + return myInventoryFetchStarted() && fetchQueueContainsNoDescendentsOf(gInventory.getRootFolderID()); +} + +/* static */ +bool LLInventoryModel::myInventoryFetchInProgress() +{ + return myInventoryFetchStarted() && !myInventoryFetchCompleted(); +} + // static bool LLInventoryModel::isEverythingFetched() { - return (sAllFoldersFetched ? true : false); + return sAllFoldersFetched; } //static @@ -1638,7 +1685,6 @@ void LLInventoryModel::startBackgroundFetch(const LLUUID& cat_id) if (!sMyInventoryFetchStarted) { sMyInventoryFetchStarted = TRUE; - sFetchQueue.push_back(gInventory.getLibraryRootFolderID()); sFetchQueue.push_back(gInventory.getRootFolderID()); gIdleCallbacks.addFunction(&LLInventoryModel::backgroundFetch, NULL); } @@ -1646,7 +1692,6 @@ void LLInventoryModel::startBackgroundFetch(const LLUUID& cat_id) { sLibraryFetchStarted = TRUE; sFetchQueue.push_back(gInventory.getLibraryRootFolderID()); - sFetchQueue.push_back(gInventory.getRootFolderID()); gIdleCallbacks.addFunction(&LLInventoryModel::backgroundFetch, NULL); } } |