summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-21 17:21:48 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2009-12-21 17:21:48 -0500
commitced5b819d74fa70fc2050b13749bfe1387340583 (patch)
tree1db75b29eabde12c9bf93108816f48370e1b7541 /indra/newview/llinventorymodel.cpp
parentd1eb2948f8a65e6f7631d836b2367ebe435e1efa (diff)
For EXT-3567: Folders should show as 'Loading...' when contents being fetched
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp55
1 files changed, 50 insertions, 5 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 0a8108899a..c8fd8d2062 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1339,8 +1339,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
@@ -1615,10 +1614,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
@@ -1637,7 +1684,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);
}
@@ -1645,7 +1691,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);
}
}