summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rwxr-xr-xindra/newview/llinventorymodel.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 7db1f29797..6d980d1564 100755
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -1013,7 +1013,7 @@ LLInventoryModel::item_array_t* LLInventoryModel::getUnlockedItemArray(const LLU
// an existing item with the matching id, or it will add the category.
void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat)
{
- if(cat->getUUID().isNull())
+ if(!cat || cat->getUUID().isNull())
{
return;
}
@@ -1027,7 +1027,7 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat)
LLPointer<LLViewerInventoryCategory> old_cat = getCategory(cat->getUUID());
if(old_cat)
{
- // We already have an old category, modify it's values
+ // We already have an old category, modify its values
U32 mask = LLInventoryObserver::NONE;
LLUUID old_parent_id = old_cat->getParentUUID();
LLUUID new_parent_id = cat->getParentUUID();
@@ -1052,7 +1052,13 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat)
{
mask |= LLInventoryObserver::LABEL;
}
- old_cat->copyViewerCategory(cat);
+ // Under marketplace, category labels are quite complex and need extra upate
+ const LLUUID marketplace_id = findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, false);
+ if (marketplace_id.notNull() && isObjectDescendentOf(cat->getUUID(), marketplace_id))
+ {
+ mask |= LLInventoryObserver::LABEL;
+ }
+ old_cat->copyViewerCategory(cat);
addChangedMask(mask, cat->getUUID());
}
else
@@ -1211,6 +1217,11 @@ void LLInventoryModel::deleteObject(const LLUUID& id)
LLPointer<LLViewerInventoryCategory> cat = (LLViewerInventoryCategory*)((LLInventoryObject*)obj);
vector_replace_with_last(*cat_list, cat);
}
+
+ // Note : We need to tell the inventory observers that those things are going to be deleted *before* the tree is cleared or they won't know what to delete (in views and view models)
+ addChangedMask(LLInventoryObserver::REMOVE, id);
+ gInventory.notifyObservers();
+
item_list = getUnlockedItemArray(id);
if(item_list)
{
@@ -1223,10 +1234,8 @@ void LLInventoryModel::deleteObject(const LLUUID& id)
delete cat_list;
mParentChildCategoryTree.erase(id);
}
- addChangedMask(LLInventoryObserver::REMOVE, id);
obj = NULL; // delete obj
updateLinkedObjectsFromPurge(id);
- gInventory.notifyObservers();
}
// Delete a particular inventory item by ID, and remove it from the server.
@@ -1435,16 +1444,17 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent)
}
mModifyMask |= mask;
- if (referent.notNull())
+ if (referent.notNull() && (mChangedItemIDs.find(referent) == mChangedItemIDs.end()))
{
mChangedItemIDs.insert(referent);
- }
+ update_marketplace_category(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)
- {
- addChangedMaskForLinks(referent, LLInventoryObserver::LABEL);
+ // 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)
+ {
+ addChangedMaskForLinks(referent, LLInventoryObserver::LABEL);
+ }
}
}
@@ -2160,12 +2170,12 @@ void LLInventoryModel::buildParentChildMap()
// implement it, we would need a set or map of uuid pairs
// which would be (folder_id, new_parent_id) to be sent up
// to the server.
- LL_INFOS() << "Lost categroy: " << cat->getUUID() << " - "
+ LL_INFOS() << "Lost category: " << cat->getUUID() << " - "
<< cat->getName() << LL_ENDL;
++lost;
// plop it into the lost & found.
LLFolderType::EType pref = cat->getPreferredType();
- if(LLFolderType::FT_NONE == pref)
+ if ((LLFolderType::FT_NONE == pref) || (LLFolderType::FT_MARKETPLACE_STOCK == pref))
{
cat->setParent(findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND));
}