From 4bf3859c09f6de2616358eccabaa1dc71171f0c6 Mon Sep 17 00:00:00 2001 From: Beeks Date: Fri, 24 Sep 2010 20:13:07 -0400 Subject: [PATCH] Tweaks to fix the channel stuff, save a bit of processing. A few options I missed with the last commit, and some minor patching because it's in the same file. --- indra/newview/llinventorymodel.cpp | 12 ++-------- indra/newview/llinventoryview.cpp | 34 ++++++++++++++++++++--------- indra/newview/llinventoryview.h | 3 ++- indra/newview/llstatusbar.cpp | 3 +++ indra/newview/lltranslate.cpp | 7 +----- indra/newview/lluserauth.cpp | 32 ++++----------------------- indra/newview/llviewerinventory.cpp | 12 +++++----- 7 files changed, 42 insertions(+), 61 deletions(-) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 693960765..77b07363f 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1516,7 +1516,7 @@ void LLInventoryModel::bulkFetch(std::string url) if (cat) { // Pre-emptive strike - if(!(gInventory.isObjectDescendentOf(cat->getUUID(), gLocalInventoryRoot))) + if(!(gInventory.isObjectDescendentOf(cat->getUUID(), gSystemFolderRoot))) { // if ( LLViewerInventoryCategory::VERSION_UNKNOWN == cat->getVersion()) @@ -2047,7 +2047,7 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const } // - if((cat_id == gLocalInventoryRoot) || gInventory.isObjectDescendentOf(cat_id, gLocalInventoryRoot)) return true; + if((cat_id == gSystemFolderRoot) || gInventory.isObjectDescendentOf(cat_id, gSystemFolderRoot)) return true; // return false; @@ -3382,14 +3382,6 @@ void LLInventoryModel::processSaveAssetIntoInventory(LLMessageSystem* msg, } } - - - - - - - - struct InventoryCallbackInfo { InventoryCallbackInfo(U32 callback, const LLUUID& inv_id) : diff --git a/indra/newview/llinventoryview.cpp b/indra/newview/llinventoryview.cpp index 041e1ea37..bc374c8b0 100644 --- a/indra/newview/llinventoryview.cpp +++ b/indra/newview/llinventoryview.cpp @@ -667,14 +667,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) { @@ -835,7 +845,7 @@ void LLInventoryView::changed(U32 mask) LLLocale locale(LLLocale::USER_LOCALE); std::string item_count_string; LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); - + //Displays a progress indication for loading the inventory, but not if it hasn't been loaded before on this PC, or we load more than expected - rkeast if(mItemCount == -1) { @@ -852,7 +862,10 @@ void LLInventoryView::changed(U32 mask) else title << " (Fetched " << item_count_string << " items of ~" << total_items << " - ~" << items_remaining << " remaining...)"; } } - else gSavedPerAccountSettings.setS32("rkeastInventoryPreviousCount", gInventory.getItemCount()); + else + { + gSavedPerAccountSettings.setS32("rkeastInventoryPreviousCount", gInventory.getItemCount()); + } title << mFilterText; setTitle(title.str()); @@ -2041,6 +2054,7 @@ void LLInventoryPanel::buildNewViews(const LLInventoryObject* objectp) { llwarns << "LLInventoryPanel::buildNewViews called with objectp->mType == " << ((S32) objectp->getType()) + << "Named " << objectp->getName() << " (shouldn't happen)" << llendl; } else if (objectp->getType() == LLAssetType::AT_CATEGORY) // build new view for category diff --git a/indra/newview/llinventoryview.h b/indra/newview/llinventoryview.h index 7ae905cb9..2a3aa1a11 100644 --- a/indra/newview/llinventoryview.h +++ b/indra/newview/llinventoryview.h @@ -322,9 +322,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. diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index f66a51970..2a1fb9e9a 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -247,6 +247,9 @@ void LLStatusBar::draw() // Per-frame updates of visibility void LLStatusBar::refresh() { + if(gDisconnected) + return; //or crash if the sim crashes; because: already ~LLMenuBarGL() + // Adding Net Stat Meter back in F32 bwtotal = gViewerThrottle.getMaxBandwidth() / 1000.f; mSGBandwidth->setMin(0.f); diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp index f406981af..d4bb75913 100644 --- a/indra/newview/lltranslate.cpp +++ b/indra/newview/lltranslate.cpp @@ -64,12 +64,7 @@ void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std getTranslateUrl(url, fromLang, toLang, mesg); // - std::string user_agent = llformat("%s %d.%d.%d (%d)", - LL_CHANNEL, - LL_VERSION_MAJOR, - LL_VERSION_MINOR, - LL_VERSION_PATCH, - LL_VERSION_BUILD ); + std::string user_agent = gCurrentVersion; // if (!m_Header.size()) diff --git a/indra/newview/lluserauth.cpp b/indra/newview/lluserauth.cpp index a092b366d..308c9f652 100644 --- a/indra/newview/lluserauth.cpp +++ b/indra/newview/lluserauth.cpp @@ -130,22 +130,8 @@ void LLUserAuth::authenticate( XMLRPC_VectorAppendString(params, "last", lastname.c_str(), 0); XMLRPC_VectorAppendString(params, "web_login_key", web_login_key.getString().c_str(), 0); XMLRPC_VectorAppendString(params, "start", start.c_str(), 0); - // - //XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name - //XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); - - //WOW NEIL YOU ARE SO AWESOME!! - - XMLRPC_VectorAppendString(params, "version", std::string( - llformat("%s", LL_CHANNEL) + " " + - llformat("%d", LL_VERSION_MAJOR) + "." + - llformat("%d", LL_VERSION_MINOR) + "." + - llformat("%d", LL_VERSION_PATCH) + "." + - llformat("%d", LL_VERSION_BUILD) - ).c_str(), 0); // Includes channel name - - XMLRPC_VectorAppendString(params, "channel", std::string(LL_CHANNEL).c_str(), 0); - + XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name + XMLRPC_VectorAppendString(params, "channel", LL_CHANNEL, 0); XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); @@ -232,18 +218,8 @@ void LLUserAuth::authenticate( XMLRPC_VectorAppendString(params, "last", lastname.c_str(), 0); XMLRPC_VectorAppendString(params, "passwd", dpasswd.c_str(), 0); XMLRPC_VectorAppendString(params, "start", start.c_str(), 0); - //Partially correct but I'm very skeptical of the gSavedSettings part. Imprudence does it, but that doesn't mean it's right... -HgB - //XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name - //XMLRPC_VectorAppendString(params, "channel", gSavedSettings.getString("VersionChannelName").c_str(), 0); - XMLRPC_VectorAppendString(params, "version", std::string( - llformat("%s", LL_CHANNEL) + " " + - llformat("%d", LL_VERSION_MAJOR) + "." + - llformat("%d", LL_VERSION_MINOR) + "." + - llformat("%d", LL_VERSION_PATCH) + "." + - llformat("%d", LL_VERSION_BUILD) - ).c_str(), 0); // Includes channel name - - XMLRPC_VectorAppendString(params, "channel", std::string(LL_CHANNEL).c_str(), 0); + XMLRPC_VectorAppendString(params, "version", gCurrentVersion.c_str(), 0); // Includes channel name + XMLRPC_VectorAppendString(params, "channel", LL_CHANNEL, 0); XMLRPC_VectorAppendString(params, "platform", PLATFORM_STRING, 0); XMLRPC_VectorAppendString(params, "mac", hashed_mac.c_str(), 0); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 6585aba49..5815a60e4 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -53,7 +53,7 @@ #include "llviewerwindow.h" // -#include "llappviewer.h" // gLocalInventoryRoot +#include "llappviewer.h" // System Folders // ///---------------------------------------------------------------------------- @@ -152,7 +152,7 @@ void LLViewerInventoryItem::cloneViewerItem(LLPointer& ne void LLViewerInventoryItem::removeFromServer() { // this check is ghetto - if((mParentUUID == gLocalInventoryRoot) || (gInventory.isObjectDescendentOf(mUUID, gLocalInventoryRoot))) + if((mParentUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))) { return; } @@ -181,7 +181,7 @@ void LLViewerInventoryItem::updateServer(BOOL is_new) const // // *FIX: deal with this better. // llwarns << "LLViewerInventoryItem::updateServer() - for unowned item" // << llendl; - if((mParentUUID == gLocalInventoryRoot) || (gInventory.isObjectDescendentOf(mUUID, gLocalInventoryRoot))) + if((mParentUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))) { // return; @@ -335,7 +335,7 @@ bool LLViewerInventoryItem::exportFileLocal(LLFILE* fp) const void LLViewerInventoryItem::updateParentOnServer(BOOL restamp) const { // - if(gInventory.isObjectDescendentOf(mUUID, gLocalInventoryRoot)) return; + if(gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot)) return; // LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MoveInventoryItem); @@ -407,7 +407,7 @@ void LLViewerInventoryCategory::copyViewerCategory(const LLViewerInventoryCatego void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const { // - if(gInventory.isObjectDescendentOf(mUUID, gLocalInventoryRoot)) return; + if(gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot)) return; // LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_MoveInventoryFolder); @@ -471,7 +471,7 @@ void LLViewerInventoryCategory::removeFromServer( void ) bool LLViewerInventoryCategory::fetchDescendents() { // - if((mUUID == gLocalInventoryRoot) || (gInventory.isObjectDescendentOf(mUUID, gLocalInventoryRoot))) return false; + if((mUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))) return false; // if((VERSION_UNKNOWN == mVersion) && mDescendentsRequested.hasExpired()) //Expired check prevents multiple downloads.