From fdd018783a0cc06a467443ca7c9ea0876a87ef49 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 27 Mar 2012 18:40:17 -0400 Subject: CHOP-854: move change_(item|category)_parent() into LLInventoryModel. It's not really clear why they're in llinventoryfunctions.{h,cpp} instead of LLInventoryModel, and in fact LLInventoryModel::removeItem() already contains code essentially cloned from change_item_parent() -- or perhaps vice-versa. This changeset addresses only migrating the functions, and fixing up existing references, to simplify code review. --- indra/newview/llinventorymodel.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'indra/newview/llinventorymodel.h') diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 7cd85c4ab7..f4602ce922 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -306,6 +306,16 @@ public: // observer notification, or server update is performed. void moveObject(const LLUUID& object_id, const LLUUID& cat_id); + // Migrated from llinventoryfunctions + void changeItemParent(LLViewerInventoryItem* item, + const LLUUID& new_parent_id, + BOOL restamp); + + // Migrated from llinventoryfunctions + void changeCategoryParent(LLViewerInventoryCategory* cat, + const LLUUID& new_parent_id, + BOOL restamp); + //-------------------------------------------------------------------- // Delete //-------------------------------------------------------------------- -- cgit v1.2.3 From b7e0e44e3246299b639f787e3ab9b8e59cdc05c3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 27 Mar 2012 22:39:31 -0400 Subject: CHOP-854: Use new LLInventoryModel::removeObject() to discard offer. Introduce new LLInventoryModel::removeCategory() method comparable to removeItem(), but for folder objects (using changeCategoryParent() rather than changeItemParent()). Introduce removeObject() method that calls one of the above, depending on runtime object type. --- indra/newview/llinventorymodel.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/newview/llinventorymodel.h') diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index f4602ce922..8382e875b4 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -325,8 +325,13 @@ public: // consistent internal state. No cache accounting, observer // notification, or server update is performed. void deleteObject(const LLUUID& id); + /// move Item item_id to Trash void removeItem(const LLUUID& item_id); - + /// move Category category_id to Trash + void removeCategory(const LLUUID& category_id); + /// removeItem() or removeCategory(), whichever is appropriate + void removeObject(const LLUUID& object_id); + // Delete a particular inventory object by ID, and delete it from // the server. Also updates linked items. void purgeObject(const LLUUID& id); -- cgit v1.2.3