summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorymodel.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2009-12-03 15:39:43 -0500
committerLoren Shih <seraph@lindenlab.com>2009-12-03 15:39:43 -0500
commit202d86b15567a783bed55849a7cdc8ad8d8f874f (patch)
treeb334bca174ada4367d100223fb2fba57c40a4847 /indra/newview/llinventorymodel.cpp
parente23d51700733e98f966c540602038686cba98d4e (diff)
EXT-2410 : Accepting an offered item should open the inventorySP
Added a new "Quiet" query for folder types, so I don't have to special case all the folders where we don't want UI notifications from inventory offers. Fixed a bug where a sidepanel was considered active even if the sidetray was closed. --HG-- branch : avatar-pipeline
Diffstat (limited to 'indra/newview/llinventorymodel.cpp')
-rw-r--r--indra/newview/llinventorymodel.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 29096ff718..fb9be1e04f 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -211,6 +211,25 @@ BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id,
return FALSE;
}
+const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(const LLUUID& obj_id) const
+{
+ const LLInventoryObject* obj = getObject(obj_id);
+ const LLUUID& parent_id = obj->getParentUUID();
+ while (!parent_id.isNull())
+ {
+ const LLViewerInventoryCategory *cat = getCategory(parent_id);
+ if (!cat) break;
+ const LLFolderType::EType folder_type = cat->getPreferredType();
+ if (folder_type != LLFolderType::FT_NONE &&
+ folder_type != LLFolderType::FT_ROOT_INVENTORY &&
+ !LLFolderType::lookupIsEnsembleType(folder_type))
+ {
+ return cat;
+ }
+ }
+ return NULL;
+}
+
// Get the object by id. Returns NULL if not found.
LLInventoryObject* LLInventoryModel::getObject(const LLUUID& id) const
{