From c52a19085f03367a3a779b1191aac0cd57b5abb9 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Mon, 12 Jul 2010 14:27:11 +0200 Subject: fix: don't change inventory floater title continously without need (take2) --- linden/indra/newview/llinventoryview.cpp | 26 ++++++++++++++++++-------- linden/indra/newview/llinventoryview.h | 3 ++- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index e6041c4..a001d65 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp @@ -674,14 +674,24 @@ void LLInventoryView::draw() { if (LLInventoryModel::isEverythingFetched()) { - LLLocale locale(LLLocale::USER_LOCALE); - std::ostringstream title; - title << "Inventory"; - std::string item_count_string; - LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); - title << " (" << item_count_string << " items)"; - title << mFilterText; - setTitle(title.str()); + S32 item_count = gInventory.getItemCount(); + + //don't let llfloater work more than necessary + if (item_count != mOldItemCount || mOldFilterText != mFilterText) + { + LLLocale locale(LLLocale::USER_LOCALE); + std::ostringstream title; + title << "Inventory"; //*TODO: make translatable + std::string item_count_string; + LLResMgr::getInstance()->getIntegerString(item_count_string, item_count); + title << " (" << item_count_string << " items)"; + title << mFilterText; + setTitle(title.str()); + } + + mOldFilterText = mFilterText; + mOldItemCount = item_count; + } if (mActivePanel && mSearchEditor) { diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h index 2650ed8..e098ac7 100644 --- a/linden/indra/newview/llinventoryview.h +++ b/linden/indra/newview/llinventoryview.h @@ -307,9 +307,10 @@ protected: LLSaveFolderState* mSavedFolderState; std::string mFilterText; + 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