diff options
author | Mike Antipov <mantipov@productengine.com> | 2010-06-08 15:13:43 +0300 |
---|---|---|
committer | Mike Antipov <mantipov@productengine.com> | 2010-06-08 15:13:43 +0300 |
commit | fe5d72a7c34e728ecca6193edfb3951dc3729d5f (patch) | |
tree | 6dfddec6bac4b52b75ce53a3c981db1b3631cdcb /indra/newview/llinventorymodel.cpp | |
parent | a62287c2b0c94a8142818a5c3348c5f55b722614 (diff) |
EXT-7503 WIP Improved LLInventoryModel::updateItem to avoid an extra calls of notifyObservers while updating calling card item.
- added check on whether avatar name exists in Name Cache before using its getter with callback (which raises notifyObservers).
Reviewed by Brad Payne at https://codereview.productengine.com/secondlife/r/526/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r-- | indra/newview/llinventorymodel.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 6fc5804a48..15760bf155 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -721,8 +721,20 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) // Valid UUID; set the item UUID and rename it new_item->setCreator(id); std::string avatar_name; - // Fetch the currect name - gCacheName->get(id, FALSE, boost::bind(&LLViewerInventoryItem::onCallingCardNameLookup, new_item.get(), _1, _2, _3)); + + if (gCacheName->getFullName(id, avatar_name)) + { + new_item->rename(avatar_name); + mask |= LLInventoryObserver::LABEL; + } + else + { + // Fetch the current name + gCacheName->get(id, FALSE, + boost::bind(&LLViewerInventoryItem::onCallingCardNameLookup, new_item.get(), + _1, _2, _3)); + } + } } else if (new_item->getType() == LLAssetType::AT_GESTURE) |