From 306cce10bd5fe99ab7b50fff9fc468e81fc7ecb2 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Wed, 8 Jun 2011 23:23:35 -0700 Subject: Fixed inventory window not showing item count on login when the full cache is loaded --- linden/indra/newview/llinventoryview.cpp | 20 ++++++++++++++------ linden/indra/newview/llinventoryview.h | 1 - 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index ec14cb3..f2fe921 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp @@ -491,7 +491,9 @@ LLInventoryView::LLInventoryView(const std::string& name, LLFloater(name, rect, std::string("Inventory"), RESIZE_YES, INV_MIN_WIDTH, INV_MIN_HEIGHT, DRAG_ON_TOP, MINIMIZE_NO, CLOSE_YES), - mActivePanel(NULL) + mActivePanel(NULL), + mOldFilterText(""), + mFilterText("") //LLHandle mFinderHandle takes care of its own initialization { init(inventory); @@ -683,10 +685,11 @@ void LLInventoryView::draw() { if (!LLInventoryModel::backgroundFetchActive()) { + static S32 old_item_count = 0; S32 item_count = gInventory.getItemCount(); //don't let llfloater work more than necessary - if (item_count != mOldItemCount || mOldFilterText != mFilterText) + if (item_count > old_item_count || mOldFilterText != mFilterText) { LLLocale locale(LLLocale::USER_LOCALE); std::ostringstream title; @@ -696,11 +699,10 @@ void LLInventoryView::draw() title << " (" << item_count_string << " items)"; title << mFilterText; setTitle(title.str()); - } - - mOldFilterText = mFilterText; - mOldItemCount = item_count; + mOldFilterText = mFilterText; + old_item_count = item_count; + } } if (mActivePanel && mSearchEditor) { @@ -889,6 +891,12 @@ void LLInventoryView::changed(U32 mask) } else { + // This is here because it gets called on login even when it shouldn't -- MC + LLLocale locale(LLLocale::USER_LOCALE); + std::string item_count_string; + LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); + title << " (" << item_count_string << " items)"; + gSavedPerAccountSettings.setS32("InventoryPreviousCount", gInventory.getItemCount()); } title << mFilterText; diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h index 3ec1e73..e499113 100644 --- a/linden/indra/newview/llinventoryview.h +++ b/linden/indra/newview/llinventoryview.h @@ -315,7 +315,6 @@ protected: std::string mOldFilterText; S32 mItemCount; - S32 mOldItemCount; // This container is used to hold all active inventory views. This // is here to support the inventory toggle show button. -- cgit v1.1