summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-05-09 00:40:30 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-05-09 00:40:30 +0300
commit5c78396b64c985a7e58d045ff3f343bccc81c8d3 (patch)
treeeddd384a6668a54dbb80c6320a957c869959cb3e /indra/newview/llinventoryfunctions.cpp
parent1c170381aea21cfd75d7b8789374f04f3a46d408 (diff)
viewer#1424 Favorites in Appearance floater #1
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rw-r--r--indra/newview/llinventoryfunctions.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 81be2c1f24..604adea125 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -2382,6 +2382,27 @@ void set_favorite(const LLUUID& obj_id, bool favorite)
}
}
+void toggle_favorite(const LLUUID& obj_id)
+{
+ LLInventoryObject* obj = gInventory.getObject(obj_id);
+
+ LLSD updates;
+ updates["favorite"] = LLSD().with("toggled", !obj->getIsFavorite());
+
+ LLPointer<LLInventoryCallback> cb = new LLUpdateFavorite(obj_id);
+
+ LLViewerInventoryCategory* view_folder = dynamic_cast<LLViewerInventoryCategory*>(obj);
+ if (view_folder)
+ {
+ update_inventory_category(obj_id, updates, cb);
+ }
+ LLViewerInventoryItem* view_item = dynamic_cast<LLViewerInventoryItem*>(obj);
+ if (view_item)
+ {
+ update_inventory_item(obj_id, updates, cb);
+ }
+}
+
std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id)
{
if (model)