summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llfolderviewitem.cpp21
-rw-r--r--indra/newview/llinventorymodel.cpp55
-rw-r--r--indra/newview/llinventorymodel.h8
3 files changed, 76 insertions, 8 deletions
diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp
index 0be449fc9f..720c2c7b1a 100644
--- a/indra/newview/llfolderviewitem.cpp
+++ b/indra/newview/llfolderviewitem.cpp
@@ -970,11 +970,26 @@ void LLFolderViewItem::draw()
font->renderUTF8( mLabel, 0, text_left, y, color,
- LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
- S32_MAX, getRect().getWidth() - (S32) text_left, &right_x, TRUE);
+ LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
+ S32_MAX, getRect().getWidth() - (S32) text_left, &right_x, TRUE);
+// LLViewerInventoryCategory *item = 0;
+// if (getListener())
+// item = gInventory.getCategory(getListener()->getUUID());
+ bool root_is_loading = false;
+ if (getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(),gInventory.getRootFolderID()))
+ {
+ // Descendent of my inventory.
+ root_is_loading = gInventory.myInventoryFetchInProgress();
+ }
+ if (getListener() && gInventory.isObjectDescendentOf(getListener()->getUUID(),gInventory.getLibraryRootFolderID()))
+ {
+ // Descendent of library
+ root_is_loading = gInventory.libraryFetchInProgress();
+ }
+
if ( (mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime"))
- || (LLInventoryModel::backgroundFetchActive() && mShowLoadStatus) )
+ || (LLInventoryModel::backgroundFetchActive() && root_is_loading && mShowLoadStatus) )
{
std::string load_string = " ( " + LLTrans::getString("LoadingData") + " ) ";
font->renderUTF8(load_string, 0, right_x, y, sSearchStatusColor,
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);
}
}
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 29f2aec89e..39377b4ae2 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -516,6 +516,14 @@ public:
// Add categories to a list to be fetched in bulk.
static void bulkFetch(std::string url);
+ static bool libraryFetchStarted();
+ static bool libraryFetchCompleted();
+ static bool libraryFetchInProgress();
+
+ static bool myInventoryFetchStarted();
+ static bool myInventoryFetchCompleted();
+ static bool myInventoryFetchInProgress();
+
private:
static BOOL sMyInventoryFetchStarted;
static BOOL sLibraryFetchStarted;