summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindra/newview/llinventorymodel.cpp11
-rwxr-xr-xindra/newview/llinventorymodel.h2
-rwxr-xr-xindra/newview/llinventoryobserver.cpp22
-rwxr-xr-xindra/newview/llinventoryobserver.h2
-rwxr-xr-xindra/newview/lllocationinputctrl.cpp6
5 files changed, 35 insertions, 8 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 268cb7d8b2..1699088b99 100755
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1514,7 +1514,7 @@ void LLInventoryModel::fetchInventoryResponder::httpSuccess()
LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem;
titem->unpackMessage(content["items"][i]);
- lldebugs << "LLInventoryModel::messageUpdateCore() item id:"
+ lldebugs << "LLInventoryModel::fetchInventoryResponder item id: "
<< titem->getUUID() << llendl;
items.push_back(titem);
// examine update for changes.
@@ -2617,7 +2617,7 @@ void LLInventoryModel::registerCallbacks(LLMessageSystem* msg)
void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, void**)
{
// do accounting and highlight new items if they arrive
- if (gInventory.messageUpdateCore(msg, true))
+ if (gInventory.messageUpdateCore(msg, true, LLInventoryObserver::UPDATE_CREATE))
{
U32 callback_id;
LLUUID item_id;
@@ -2637,7 +2637,7 @@ void LLInventoryModel::processFetchInventoryReply(LLMessageSystem* msg, void**)
}
-bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
+bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account, U32 mask)
{
//make sure our added inventory observer is active
start_new_inventory_observer();
@@ -2691,7 +2691,10 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account)
}
U32 changes = 0x0;
- U32 mask = account ? LLInventoryObserver::CREATE : 0x0;
+ if (account)
+ {
+ mask |= LLInventoryObserver::CREATE;
+ }
//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)
{
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index 1e18adf8d6..41ab895e84 100755
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -556,7 +556,7 @@ public:
static void processMoveInventoryItem(LLMessageSystem* msg, void**);
static void processFetchInventoryReply(LLMessageSystem* msg, void**);
protected:
- bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting);
+ bool messageUpdateCore(LLMessageSystem* msg, bool do_accounting, U32 mask = 0x0);
//--------------------------------------------------------------------
// Locks
diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp
index f71cf26b30..996decde8c 100755
--- a/indra/newview/llinventoryobserver.cpp
+++ b/indra/newview/llinventoryobserver.cpp
@@ -465,9 +465,13 @@ void LLInventoryFetchComboObserver::startFetch()
mFetchDescendents->startFetch();
}
+// See comment preceding LLInventoryAddedObserver::changed() for some
+// concerns that also apply to this observer.
void LLInventoryAddItemByAssetObserver::changed(U32 mask)
{
- if(!(mask & LLInventoryObserver::ADD) || !(mask & LLInventoryObserver::CREATE))
+ if(!(mask & LLInventoryObserver::ADD) ||
+ !(mask & LLInventoryObserver::CREATE) ||
+ !(mask & LLInventoryObserver::UPDATE_CREATE))
{
return;
}
@@ -526,9 +530,23 @@ bool LLInventoryAddItemByAssetObserver::isAssetWatched( const LLUUID& asset_id )
return std::find(mWatchedAssets.begin(), mWatchedAssets.end(), asset_id) != mWatchedAssets.end();
}
+// This observer used to explicitly check for whether it was being
+// called as a result of an UpdateCreateInventoryItem message. It has
+// now been decoupled enough that it's not actually checking the
+// message system, but now we have the special UPDATE_CREATE flag
+// being used for the same purpose. Fixing this, as we would need to
+// do to get rid of the message, is somewhat subtle because there's no
+// particular obvious criterion for when creating a new item should
+// trigger this observer and when it shouldn't. For example, creating
+// a new notecard with new->notecard causes a preview window to pop up
+// via the derived class LLOpenTaskOffer, but creating a new notecard
+// by copy and paste does not, solely because one goes through
+// UpdateCreateInventoryItem and the other doesn't.
void LLInventoryAddedObserver::changed(U32 mask)
{
- if (!(mask & LLInventoryObserver::ADD) || !(mask & LLInventoryObserver::CREATE))
+ if (!(mask & LLInventoryObserver::ADD) ||
+ !(mask & LLInventoryObserver::CREATE) ||
+ !(mask & LLInventoryObserver::UPDATE_CREATE))
{
return;
}
diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h
index 2436930ef6..8cf6a6bdab 100755
--- a/indra/newview/llinventoryobserver.h
+++ b/indra/newview/llinventoryobserver.h
@@ -59,6 +59,8 @@ public:
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.
+ // unfortunately a particular message is still associated with some unique semantics.
+ UPDATE_CREATE = 1024, // With ADD, item added via UpdateCreateInventoryItem
ALL = 0xffffffff
};
LLInventoryObserver();
diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp
index 7b97b26a37..dcfe3cc9a7 100755
--- a/indra/newview/lllocationinputctrl.cpp
+++ b/indra/newview/lllocationinputctrl.cpp
@@ -140,7 +140,11 @@ public:
private:
/*virtual*/ void changed(U32 mask)
{
- if (mask & (~(LLInventoryObserver::LABEL|LLInventoryObserver::INTERNAL|LLInventoryObserver::ADD|LLInventoryObserver::CREATE)))
+ if (mask & (~(LLInventoryObserver::LABEL|
+ LLInventoryObserver::INTERNAL|
+ LLInventoryObserver::ADD|
+ LLInventoryObserver::CREATE|
+ LLInventoryObserver::UPDATE_CREATE)))
{
mInput->updateAddLandmarkButton();
}