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 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'linden/indra/newview/llinventoryview.cpp') 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) { -- cgit v1.1