summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-10-23 15:21:49 +0000
committerLoren Shih <seraph@lindenlab.com>2009-10-23 15:21:49 +0000
commit584962d5c79097904fec0102f78ea4aa7482a337 (patch)
tree95c79b7a41e5c39d3e1f3d7e5710842cd12c3425 /indra/newview/llinventorymodel.cpp
parent9c3ae7a2436c970d3959938ddc29c2d291844ecc (diff)
svn merge -r137024:137071 svn+ssh://svn.lindenlab.com/svn/linden/branches/avatar-pipeline/avatar-pipeline-14-seraph into svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-2.0.0-3
Bugs: EXT-1785 EXT-1818 EXT-1820 EXT-1845
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp37
1 files changed, 31 insertions, 6 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 2f3171a868..6009e8e610 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -507,8 +507,12 @@ void LLInventoryModel::collectDescendentsIf(const LLUUID& id,
}
}
-void LLInventoryModel::updateLinkedObjects(const LLUUID& object_id)
+void LLInventoryModel::updateLinkedItems(const LLUUID& object_id)
{
+ const LLInventoryObject *obj = getObject(object_id);
+ if (!obj || obj->getIsLinkType())
+ return;
+
LLInventoryModel::cat_array_t cat_array;
LLInventoryModel::item_array_t item_array;
LLLinkedItemIDMatches is_linked_item_match(object_id);
@@ -536,16 +540,31 @@ void LLInventoryModel::updateLinkedObjects(const LLUUID& object_id)
notifyObservers();
}
-void LLInventoryModel::collectLinkedItems(const LLUUID& id,
- item_array_t& items)
+const LLUUID& LLInventoryModel::getLinkedItemID(const LLUUID& object_id) const
{
+ const LLInventoryItem *item = gInventory.getItem(object_id);
+ if (!item)
+ {
+ return object_id;
+ }
+
+ // Find the base item in case this a link (if it's not a link,
+ // this will just be inv_item_id)
+ return item->getLinkedUUID();
+}
+
+LLInventoryModel::item_array_t LLInventoryModel::collectLinkedItems(const LLUUID& id,
+ const LLUUID& start_folder_id)
+{
+ item_array_t items;
LLInventoryModel::cat_array_t cat_array;
LLLinkedItemIDMatches is_linked_item_match(id);
- collectDescendentsIf(gInventory.getRootFolderID(),
+ collectDescendentsIf((start_folder_id == LLUUID::null ? gInventory.getRootFolderID() : start_folder_id),
cat_array,
items,
LLInventoryModel::INCLUDE_TRASH,
is_linked_item_match);
+ return items;
}
// Generates a string containing the path to the item specified by
@@ -909,8 +928,7 @@ void LLInventoryModel::purgeLinkedObjects(const LLUUID &id)
return;
}
- LLInventoryModel::item_array_t item_array;
- collectLinkedItems(id, item_array);
+ LLInventoryModel::item_array_t item_array = collectLinkedItems(id);
for (LLInventoryModel::item_array_t::iterator iter = item_array.begin();
iter != item_array.end();
@@ -1131,6 +1149,13 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent)
{
mChangedItemIDs.insert(referent);
}
+
+ // Update all linked items. Starting with just LABEL because I'm
+ // not sure what else might need to be accounted for this.
+ if (mModifyMask & LLInventoryObserver::LABEL)
+ {
+ updateLinkedItems(referent);
+ }
}
// This method to prepares a set of mock inventory which provides