parent
a9a2e7c633
commit
b96c7ec6e6
|
|
@ -2298,6 +2298,7 @@ public:
|
||||||
|
|
||||||
void removeItemID(const LLUUID& id) override;
|
void removeItemID(const LLUUID& id) override;
|
||||||
bool isInRootContent(const LLUUID& id, LLFolderViewItem* view_item) override;
|
bool isInRootContent(const LLUUID& id, LLFolderViewItem* view_item) override;
|
||||||
|
bool hasPredecessorsInRootContent(const LLInventoryObject* model_item) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LLInventoryFavoritesItemsPanel(const Params&);
|
LLInventoryFavoritesItemsPanel(const Params&);
|
||||||
|
|
@ -2344,6 +2345,24 @@ bool LLInventoryFavoritesItemsPanel::isInRootContent(const LLUUID& id, LLFolderV
|
||||||
return found != mRootContentIDs.end();
|
return found != mRootContentIDs.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool LLInventoryFavoritesItemsPanel::hasPredecessorsInRootContent(const LLInventoryObject* obj) const
|
||||||
|
{
|
||||||
|
LLUUID parent_id = obj->getParentUUID();
|
||||||
|
while (parent_id.notNull())
|
||||||
|
{
|
||||||
|
if (mRootContentIDs.contains(parent_id))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
LLViewerInventoryCategory* cat = mInventory->getCategory(parent_id);
|
||||||
|
if (cat)
|
||||||
|
{
|
||||||
|
parent_id = cat->getParentUUID();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void LLInventoryFavoritesItemsPanel::findAndInitRootContent(const LLUUID& id)
|
void LLInventoryFavoritesItemsPanel::findAndInitRootContent(const LLUUID& id)
|
||||||
{
|
{
|
||||||
F64 curent_time = LLTimer::getTotalSeconds();
|
F64 curent_time = LLTimer::getTotalSeconds();
|
||||||
|
|
@ -2495,7 +2514,8 @@ void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, con
|
||||||
}
|
}
|
||||||
|
|
||||||
LLFolderViewItem* folder_view_item = getItemByID(cat->getUUID());
|
LLFolderViewItem* folder_view_item = getItemByID(cat->getUUID());
|
||||||
if (!folder_view_item)
|
if (!folder_view_item
|
||||||
|
&& !hasPredecessorsInRootContent(model_item))
|
||||||
{
|
{
|
||||||
const LLUUID& parent_id = cat->getParentUUID();
|
const LLUUID& parent_id = cat->getParentUUID();
|
||||||
mRootContentIDs.emplace(cat->getUUID());
|
mRootContentIDs.emplace(cat->getUUID());
|
||||||
|
|
@ -2507,7 +2527,9 @@ void LLInventoryFavoritesItemsPanel::itemChanged(const LLUUID& id, U32 mask, con
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// New favorite item
|
// New favorite item
|
||||||
if (model_item->getIsFavorite() && typedViewsFilter(id, model_item))
|
if (model_item->getIsFavorite()
|
||||||
|
&& typedViewsFilter(id, model_item)
|
||||||
|
&& !hasPredecessorsInRootContent(model_item))
|
||||||
{
|
{
|
||||||
const LLUUID& parent_id = model_item->getParentUUID();
|
const LLUUID& parent_id = model_item->getParentUUID();
|
||||||
mRootContentIDs.emplace(id);
|
mRootContentIDs.emplace(id);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue