diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-11-04 15:55:04 -0500 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2013-11-04 15:55:04 -0500 |
commit | 6ea320198afcd3080fd7fcdfcb5829b5e8ef2c31 (patch) | |
tree | 52f0334948e2cc149d4a14e3b5286d864613ab9c /indra | |
parent | 72097affb53b8c8aa28e029eba0033630bca41b0 (diff) |
SH-4595 WIP - use new LLInventoryObserver::CREATE flag to distinguish newly created items from existing ones being added to inventory.
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llinventorymodel.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/llinventorymodel.h | 2 | ||||
-rwxr-xr-x | indra/newview/llinventoryobserver.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llinventoryobserver.h | 1 |
4 files changed, 7 insertions, 6 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index e9bbf3a7cd..1ad70492ca 100755 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -774,9 +774,8 @@ bool LLInventoryModel::isInventoryUsable() const // Calling this method with an inventory item will either change an // existing item with a matching item_id, or will add the item to the // current inventory. -U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) +U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item, U32 mask) { - U32 mask = LLInventoryObserver::NONE; if(item->getUUID().isNull()) { return mask; @@ -2652,10 +2651,11 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account) } U32 changes = 0x0; + U32 mask = account ? LLInventoryObserver::CREATE : 0x0; //as above, this loop never seems to loop more than once per call for (item_array_t::iterator it = items.begin(); it != items.end(); ++it) { - changes |= gInventory.updateItem(*it); + changes |= gInventory.updateItem(*it, mask); } gInventory.notifyObservers(); gViewerWindow->getWindow()->decBusyCount(); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 339740870d..779319fa67 100755 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -298,7 +298,7 @@ public: // NOTE: In usage, you will want to perform cache accounting // operations in LLInventoryModel::accountForUpdate() or // LLViewerInventoryItem::updateServer() before calling this method. - U32 updateItem(const LLViewerInventoryItem* item); + U32 updateItem(const LLViewerInventoryItem* item, U32 mask = 0); // Change an existing item with the matching id or add // the category. No notifcation will be sent to observers. This diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index b025c0786e..011686bfdd 100755 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -467,7 +467,7 @@ void LLInventoryFetchComboObserver::startFetch() void LLInventoryAddItemByAssetObserver::changed(U32 mask) { - if(!(mask & LLInventoryObserver::ADD)) + if(!(mask & LLInventoryObserver::ADD) || !(mask & LLInventoryObserver::CREATE)) { return; } @@ -528,7 +528,7 @@ bool LLInventoryAddItemByAssetObserver::isAssetWatched( const LLUUID& asset_id ) void LLInventoryAddedObserver::changed(U32 mask) { - if (!(mask & LLInventoryObserver::ADD)) + if (!(mask & LLInventoryObserver::ADD) || !(mask & LLInventoryObserver::CREATE)) { return; } diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index c3cd0d761e..dd30513844 100755 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -58,6 +58,7 @@ public: GESTURE = 64, REBUILD = 128, // Item UI changed (e.g. item type different) SORT = 256, // Folder needs to be resorted. + CREATE = 512, // With ADD, item has just been created. ALL = 0xffffffff }; LLInventoryObserver(); |