summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llinventoryfunctions.cpp32
-rw-r--r--indra/newview/llinventoryfunctions.h1
-rw-r--r--indra/newview/llpanelwearing.cpp2
-rw-r--r--indra/newview/llwearableitemslist.cpp2
4 files changed, 29 insertions, 8 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index ca27ea8b3f..eac5661847 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -2458,12 +2458,6 @@ private:
void favorite_send(LLInventoryObject* obj, const LLUUID& obj_id, bool favorite)
{
- LLSD val;
- if (favorite)
- {
- val = true;
- } // else leave undefined to remove unneeded metadata field
-
LLSD updates;
if (favorite)
{
@@ -2517,6 +2511,13 @@ void set_favorite(const LLUUID& obj_id, bool favorite)
if (obj && obj->getIsLinkType())
{
+ if (!favorite && obj->getIsFavorite())
+ {
+ // Links currently aren't supposed to be favorites,
+ // instead should show state of the original
+ LL_INFOS("Inventory") << "Recovering proper 'favorites' state of a link " << obj_id << LL_ENDL;
+ favorite_send(obj, obj_id, false);
+ }
obj = gInventory.getObject(obj->getLinkedUUID());
}
@@ -2540,6 +2541,25 @@ void toggle_favorite(const LLUUID& obj_id)
}
}
+void toggle_favorites(const uuid_vec_t& ids)
+{
+ if (ids.size() == 0)
+ {
+ return;
+ }
+ if (ids.size() == 1)
+ {
+ toggle_favorite(ids[0]);
+ return;
+ }
+
+ bool new_val = !get_is_favorite(ids.front());
+ for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it)
+ {
+ set_favorite(*it, new_val);
+ }
+}
+
std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id)
{
if (model)
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index fdb6fc77d7..f2fa7b3fe5 100644
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -120,6 +120,7 @@ bool get_is_favorite(const LLInventoryObject* object);
bool get_is_favorite(const LLUUID& obj_id);
void set_favorite(const LLUUID& obj_id, bool favorite);
void toggle_favorite(const LLUUID& obj_id);
+void toggle_favorites(const uuid_vec_t& ids);
std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id);
std::string get_searchable_creator_name(LLInventoryModel* model, const LLUUID& item_id);
std::string get_searchable_UUID(LLInventoryModel* model, const LLUUID& item_id);
diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp
index be8321e7bc..79b40e392a 100644
--- a/indra/newview/llpanelwearing.cpp
+++ b/indra/newview/llpanelwearing.cpp
@@ -113,7 +113,7 @@ protected:
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs, no_op));
registrar.add("Wearing.Detach",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), mUUIDs, no_op));
- registrar.add("Wearing.Favorite", boost::bind(toggle_favorite, mUUIDs.front()));
+ registrar.add("Wearing.Favorite", boost::bind(toggle_favorites, mUUIDs));
LLContextMenu* menu = createFromFile("menu_wearing_tab.xml");
updateMenuItemsVisibility(menu);
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 3ddd0c30ea..982e397748 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -936,7 +936,7 @@ LLContextMenu* LLWearableItemsList::ContextMenu::createMenu()
// Register handlers for attachments.
registrar.add("Attachment.Detach",
boost::bind(&LLAppearanceMgr::removeItemsFromAvatar, LLAppearanceMgr::getInstance(), ids, no_op));
- registrar.add("Attachment.Favorite", boost::bind(toggle_favorite, selected_id));
+ registrar.add("Attachment.Favorite", boost::bind(toggle_favorites, ids));
registrar.add("Attachment.Touch", boost::bind(handle_attachment_touch, selected_id));
registrar.add("Attachment.Profile", boost::bind(show_item_profile, selected_id));
registrar.add("Object.Attach", boost::bind(LLViewerAttachMenu::attachObjects, ids, _2));