From 384d694aba523218490ec48c22d97b63acbffd6f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 23 Apr 2024 23:28:58 +0300 Subject: viewer#1300 Inventory favorites context menu --- indra/newview/llinventoryfunctions.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index ea0566f5c4..b95d75a782 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2344,6 +2344,26 @@ void ungroup_folder_items(const LLUUID& folder_id) gInventory.notifyObservers(); } +void set_favorite(const LLUUID& obj_id, bool favorite) +{ + LLInventoryObject* obj = gInventory.getObject(obj_id); + if (obj->getIsFavorite() != favorite) + { + LLSD updates; + updates["favorite"] = LLSD().with("toggled", favorite); + LLViewerInventoryCategory* view_folder = dynamic_cast(obj); + if (view_folder) + { + update_inventory_category(obj_id, updates, NULL); + } + LLViewerInventoryItem* view_item = dynamic_cast(obj); + if (view_item) + { + update_inventory_item(obj_id, updates, NULL); + } + } +} + std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id) { if (model) @@ -3322,6 +3342,20 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root ungroup_folder_items(*ids.begin()); } } + else if ("add_to_favorites" == action) + { + for (const LLUUID& id : ids) + { + set_favorite(id, true); + } + } + else if ("remove_from_favorites" == action) + { + for (const LLUUID& id : ids) + { + set_favorite(id, false); + } + } else { std::set::iterator set_iter; -- cgit v1.2.3 From a0c4d81080fbc4b5326e6b598e5df27e01631d48 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 27 Apr 2024 05:01:36 +0300 Subject: viewer#1300 'Star' favorites in inventory #2 --- indra/newview/llinventoryfunctions.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index b95d75a782..135dfa3519 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2344,6 +2344,21 @@ void ungroup_folder_items(const LLUUID& folder_id) gInventory.notifyObservers(); } +class LLUpdateFavorite : public LLInventoryCallback +{ +public: + LLUpdateFavorite(const LLUUID& inv_item_id) + : mInvItemID(inv_item_id) + {} + /* virtual */ void fire(const LLUUID& inv_item_id) override + { + gInventory.addChangedMask(LLInventoryObserver::UPDATE_FAVORITE, mInvItemID); + gInventory.notifyObservers(); + } +private: + LLUUID mInvItemID; +}; + void set_favorite(const LLUUID& obj_id, bool favorite) { LLInventoryObject* obj = gInventory.getObject(obj_id); @@ -2351,15 +2366,18 @@ void set_favorite(const LLUUID& obj_id, bool favorite) { LLSD updates; updates["favorite"] = LLSD().with("toggled", favorite); + + LLPointer cb = new LLUpdateFavorite(obj_id); + LLViewerInventoryCategory* view_folder = dynamic_cast(obj); if (view_folder) { - update_inventory_category(obj_id, updates, NULL); + update_inventory_category(obj_id, updates, cb); } LLViewerInventoryItem* view_item = dynamic_cast(obj); if (view_item) { - update_inventory_item(obj_id, updates, NULL); + update_inventory_item(obj_id, updates, cb); } } } -- cgit v1.2.3 From db3e5afbfbbce73e8f8339e8b4f938f11023ca64 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 2 May 2024 23:10:51 +0300 Subject: Viewer#1301 Implement Inventory Favorites Tab --- indra/newview/llinventoryfunctions.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 135dfa3519..81be2c1f24 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2663,6 +2663,20 @@ bool LLIsTypeWithPermissions::operator()(LLInventoryCategory* cat, LLInventoryIt return FALSE; } +bool LLFavoritesCollector::operator()(LLInventoryCategory* cat, + LLInventoryItem* item) +{ + if (item && item->getIsFavorite()) + { + return true; + } + if (cat && cat->getIsFavorite()) + { + return true; + } + return false; +} + bool LLBuddyCollector::operator()(LLInventoryCategory* cat, LLInventoryItem* item) { -- cgit v1.2.3 From 5c78396b64c985a7e58d045ff3f343bccc81c8d3 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 9 May 2024 00:40:30 +0300 Subject: viewer#1424 Favorites in Appearance floater #1 --- indra/newview/llinventoryfunctions.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'indra/newview/llinventoryfunctions.cpp') 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 cb = new LLUpdateFavorite(obj_id); + + LLViewerInventoryCategory* view_folder = dynamic_cast(obj); + if (view_folder) + { + update_inventory_category(obj_id, updates, cb); + } + LLViewerInventoryItem* view_item = dynamic_cast(obj); + if (view_item) + { + update_inventory_item(obj_id, updates, cb); + } +} + std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id) { if (model) -- cgit v1.2.3 From a420e84f4822d19388241f99a916dacc4d1eab61 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 9 May 2024 23:22:26 +0300 Subject: viewer#1424 Favorites in Appearance floater #2 --- indra/newview/llinventoryfunctions.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 604adea125..123d47b474 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2364,8 +2364,21 @@ void set_favorite(const LLUUID& obj_id, bool favorite) LLInventoryObject* obj = gInventory.getObject(obj_id); if (obj->getIsFavorite() != favorite) { + LLSD val; + if (favorite) + { + val = true; + } // else leave undefined to remove unneeded metadata field + LLSD updates; - updates["favorite"] = LLSD().with("toggled", favorite); + if (favorite) + { + updates["favorite"] = LLSD().with("toggled", true); + } + else + { + updates["favorite"] = LLSD(); + } LLPointer cb = new LLUpdateFavorite(obj_id); @@ -2385,9 +2398,20 @@ void set_favorite(const LLUUID& obj_id, bool favorite) void toggle_favorite(const LLUUID& obj_id) { LLInventoryObject* obj = gInventory.getObject(obj_id); + if (!obj) + { + return; + } LLSD updates; - updates["favorite"] = LLSD().with("toggled", !obj->getIsFavorite()); + if (!obj->getIsFavorite()) + { + updates["favorite"] = LLSD().with("toggled", true); + } + else + { + updates["favorite"] = LLSD(); + } LLPointer cb = new LLUpdateFavorite(obj_id); -- cgit v1.2.3 From 738cf84c340d8ade3ab462340d1444c4e70ef9f5 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 9 May 2024 23:51:11 +0300 Subject: viewer#1424 Favorite support for items in outfits For now marking originals, pointless to marks links in COF, needs a revision due to inconsistency with inventory --- indra/newview/llinventoryfunctions.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 123d47b474..3e19bf885d 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2427,6 +2427,19 @@ void toggle_favorite(const LLUUID& obj_id) } } +void toggle_linked_favorite(const LLUUID& obj_id) +{ + LLViewerInventoryItem* item = gInventory.getItem(obj_id); + if (!item) + { + LL_WARNS() << "Invalid item" << LL_ENDL; + return; + } + + LLUUID linked_id = item->getLinkedUUID(); + toggle_favorite(linked_id); +} + std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id) { if (model) -- cgit v1.2.3 From 25b19eb6b8b8482d5f6cff0cae8665a0f7518eb1 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 17 May 2024 22:22:45 +0300 Subject: viewer#1424 Proper links support for favorites --- indra/newview/llinventoryfunctions.cpp | 117 +++++++++++++++++++-------------- 1 file changed, 69 insertions(+), 48 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 3e19bf885d..930e9e48ea 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2353,58 +2353,40 @@ public: /* virtual */ void fire(const LLUUID& inv_item_id) override { gInventory.addChangedMask(LLInventoryObserver::UPDATE_FAVORITE, mInvItemID); - gInventory.notifyObservers(); - } -private: - LLUUID mInvItemID; -}; -void set_favorite(const LLUUID& obj_id, bool favorite) -{ - LLInventoryObject* obj = gInventory.getObject(obj_id); - if (obj->getIsFavorite() != favorite) - { - LLSD val; - if (favorite) - { - val = true; - } // else leave undefined to remove unneeded metadata field + LLInventoryModel::item_array_t items; + LLInventoryModel::cat_array_t cat_array; + LLLinkedItemIDMatches matches(mInvItemID); + gInventory.collectDescendentsIf(gInventory.getRootFolderID(), + cat_array, + items, + LLInventoryModel::INCLUDE_TRASH, + matches); - LLSD updates; - if (favorite) + std::set link_ids; + for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); ++it) { - updates["favorite"] = LLSD().with("toggled", true); - } - else - { - updates["favorite"] = LLSD(); - } + LLPointer item = *it; - LLPointer cb = new LLUpdateFavorite(obj_id); - - LLViewerInventoryCategory* view_folder = dynamic_cast(obj); - if (view_folder) - { - update_inventory_category(obj_id, updates, cb); - } - LLViewerInventoryItem* view_item = dynamic_cast(obj); - if (view_item) - { - update_inventory_item(obj_id, updates, cb); + gInventory.addChangedMask(LLInventoryObserver::UPDATE_FAVORITE, item->getUUID()); } + + gInventory.notifyObservers(); } -} +private: + LLUUID mInvItemID; +}; -void toggle_favorite(const LLUUID& obj_id) +void favorite_send(LLInventoryObject* obj, const LLUUID& obj_id, bool favorite) { - LLInventoryObject* obj = gInventory.getObject(obj_id); - if (!obj) + LLSD val; + if (favorite) { - return; - } + val = true; + } // else leave undefined to remove unneeded metadata field LLSD updates; - if (!obj->getIsFavorite()) + if (favorite) { updates["favorite"] = LLSD().with("toggled", true); } @@ -2427,17 +2409,56 @@ void toggle_favorite(const LLUUID& obj_id) } } -void toggle_linked_favorite(const LLUUID& obj_id) +bool get_is_favorite(const LLInventoryObject* object) { - LLViewerInventoryItem* item = gInventory.getItem(obj_id); - if (!item) + if (object->getIsLinkType()) { - LL_WARNS() << "Invalid item" << LL_ENDL; - return; + LLInventoryObject* obj = gInventory.getObject(object->getLinkedUUID()); + return obj && obj->getIsFavorite(); + } + + return object->getIsFavorite(); +} + +bool get_is_favorite(const LLUUID& obj_id) +{ + LLInventoryObject* object = gInventory.getObject(obj_id); + if (object && object->getIsLinkType()) + { + LLInventoryObject* obj = gInventory.getObject(object->getLinkedUUID()); + return obj && obj->getIsFavorite(); + } + + return object->getIsFavorite(); +} + +void set_favorite(const LLUUID& obj_id, bool favorite) +{ + LLInventoryObject* obj = gInventory.getObject(obj_id); + + if (obj && obj->getIsLinkType()) + { + obj = gInventory.getObject(obj_id); + } + + if (obj && obj->getIsFavorite() != favorite) + { + favorite_send(obj, obj_id, favorite); + } +} + +void toggle_favorite(const LLUUID& obj_id) +{ + LLInventoryObject* obj = gInventory.getObject(obj_id); + if (obj && obj->getIsLinkType()) + { + obj = gInventory.getObject(obj_id); } - LLUUID linked_id = item->getLinkedUUID(); - toggle_favorite(linked_id); + if (obj) + { + favorite_send(obj, obj_id, !obj->getIsFavorite()); + } } std::string get_searchable_description(LLInventoryModel* model, const LLUUID& item_id) -- cgit v1.2.3 From 9f00bb19b189753d9f801e080a87c821dcdcc8af Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 31 May 2024 12:21:36 +0300 Subject: viewer#1600 Fixed being unable to delete links to worn objects --- indra/newview/llinventoryfunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 016b0880eb..be9a20b924 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -3185,7 +3185,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root for (LLInventoryModel::item_array_t::value_type& item : items) { - if (get_is_item_worn(item)) + if (!item->getIsLinkType() && get_is_item_worn(item)) { has_worn = true; LLWearableType::EType type = item->getWearableType(); @@ -3205,7 +3205,7 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root } } LLViewerInventoryItem* item = gInventory.getItem(obj_id); - if (item && get_is_item_worn(item)) + if (item && !item->getIsLinkType() && get_is_item_worn(item)) { has_worn = true; LLWearableType::EType type = item->getWearableType(); -- cgit v1.2.3 From db3f7eafa05636a3079037109d3d21514b25a8bb Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 4 Jun 2024 02:08:12 +0300 Subject: viewer#1588 Upload directly to Specified Inventory Folder --- indra/newview/llinventoryfunctions.cpp | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index be9a20b924..909dea050e 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -51,6 +51,7 @@ #include "lldirpicker.h" #include "lldonotdisturbnotificationstorage.h" #include "llfloatermarketplacelistings.h" +#include "llfloatermodelpreview.h" #include "llfloatersidepanelcontainer.h" #include "llfocusmgr.h" #include "llfolderview.h" @@ -62,6 +63,7 @@ #include "llinventorymodel.h" #include "llinventorypanel.h" #include "lllineeditor.h" +#include "llmaterialeditor.h" #include "llmarketplacenotifications.h" #include "llmarketplacefunctions.h" #include "llmenugl.h" @@ -86,6 +88,7 @@ #include "llviewermessage.h" #include "llviewerfoldertype.h" #include "llviewerobjectlist.h" +#include "llviewermenufile.h" #include "llviewerregion.h" #include "llviewerwindow.h" #include "llvoavatarself.h" @@ -3548,6 +3551,54 @@ void LLInventoryAction::removeItemFromDND(LLFolderView* root) } } +void LLInventoryAction::fileUploadLocation(const LLUUID& dest_id, const std::string& action) +{ + if (action == "def_model") + { + gSavedPerAccountSettings.setString("ModelUploadFolder", dest_id.asString()); + } + else if (action == "def_texture") + { + gSavedPerAccountSettings.setString("TextureUploadFolder", dest_id.asString()); + } + else if (action == "def_sound") + { + gSavedPerAccountSettings.setString("SoundUploadFolder", dest_id.asString()); + } + else if (action == "def_animation") + { + gSavedPerAccountSettings.setString("AnimationUploadFolder", dest_id.asString()); + } + else if (action == "def_pbr_material") + { + gSavedPerAccountSettings.setString("PBRUploadFolder", dest_id.asString()); + } + else if (action == "upload_texture") + { + LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, dest_id), LLFilePicker::FFLOAD_IMAGE, false); + } + else if (action == "upload_sound") + { + LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, dest_id), LLFilePicker::FFLOAD_WAV, false); + } + else if (action == "upload_animation") + { + LLFilePickerReplyThread::startPicker(boost::bind(&upload_single_file, _1, _2, dest_id), LLFilePicker::FFLOAD_ANIM, false); + } + else if (action == "upload_model") + { + LLFloaterModelPreview::showModelPreview(dest_id); + } + else if (action == "upload_pbr_material") + { + LLMaterialEditor::importMaterial(dest_id); + } + else if (action == "upload_bulk") + { + LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, dest_id), LLFilePicker::FFLOAD_ALL, true); + } +} + void LLInventoryAction::onItemsRemovalConfirmation(const LLSD& notification, const LLSD& response, LLHandle root) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); -- cgit v1.2.3 From 6ee6d19f600bb7fee99f96e8476e2c57088dad17 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 26 Jun 2024 14:48:02 +0300 Subject: viewer#1005 Review fixes --- indra/newview/llinventoryfunctions.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 4fbd8856b9..28d79b7665 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2514,12 +2514,12 @@ void set_favorite(const LLUUID& obj_id, bool favorite) if (obj && obj->getIsLinkType()) { - obj = gInventory.getObject(obj_id); + obj = gInventory.getObject(obj->getLinkedUUID()); } if (obj && obj->getIsFavorite() != favorite) { - favorite_send(obj, obj_id, favorite); + favorite_send(obj, obj->getUUID(), favorite); } } @@ -2528,12 +2528,12 @@ void toggle_favorite(const LLUUID& obj_id) LLInventoryObject* obj = gInventory.getObject(obj_id); if (obj && obj->getIsLinkType()) { - obj = gInventory.getObject(obj_id); + obj = gInventory.getObject(obj->getLinkedUUID()); } if (obj) { - favorite_send(obj, obj_id, !obj->getIsFavorite()); + favorite_send(obj, obj->getUUID(), !obj->getIsFavorite()); } } -- cgit v1.2.3 From f010ab9d28396894f7510b090b4e366cd3a72289 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 3 Jul 2024 13:00:32 +0300 Subject: viewer#1300 Small 'favorites' improvement --- indra/newview/llinventoryfunctions.cpp | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') 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) -- cgit v1.2.3 From 3142429fd4b3977e36d7ab7b0605470936b32b09 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 15 Apr 2025 22:37:19 +0300 Subject: #3910 Sometimes can't favorite a folder due to version mismatch. Should use LLInventoryModel::changeItemParent --- indra/newview/llinventoryfunctions.cpp | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'indra/newview/llinventoryfunctions.cpp') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 22ee036a6d..a2626daa2e 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -2150,21 +2150,10 @@ void validate_marketplacelistings( void change_item_parent(const LLUUID& item_id, const LLUUID& new_parent_id) { - LLInventoryItem* inv_item = gInventory.getItem(item_id); + LLViewerInventoryItem* inv_item = gInventory.getItem(item_id); if (inv_item) { - LLInventoryModel::update_list_t update; - LLInventoryModel::LLCategoryUpdate old_folder(inv_item->getParentUUID(), -1); - update.push_back(old_folder); - LLInventoryModel::LLCategoryUpdate new_folder(new_parent_id, 1); - update.push_back(new_folder); - gInventory.accountForUpdate(update); - - LLPointer new_item = new LLViewerInventoryItem(inv_item); - new_item->setParent(new_parent_id); - new_item->updateParentOnServer(false); - gInventory.updateItem(new_item); - gInventory.notifyObservers(); + gInventory.changeItemParent(inv_item, new_parent_id, false); } } @@ -2172,17 +2161,17 @@ void move_items_to_folder(const LLUUID& new_cat_uuid, const uuid_vec_t& selected { for (uuid_vec_t::const_iterator it = selected_uuids.begin(); it != selected_uuids.end(); ++it) { - LLInventoryItem* inv_item = gInventory.getItem(*it); + LLViewerInventoryItem* inv_item = gInventory.getItem(*it); if (inv_item) { - change_item_parent(*it, new_cat_uuid); + gInventory.changeItemParent(inv_item, new_cat_uuid, false); } else { - LLInventoryCategory* inv_cat = gInventory.getCategory(*it); + LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); if (inv_cat && !LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType())) { - gInventory.changeCategoryParent((LLViewerInventoryCategory*)inv_cat, new_cat_uuid, false); + gInventory.changeCategoryParent(inv_cat, new_cat_uuid, false); } } } @@ -3577,7 +3566,6 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root } else if ("new_folder_from_selected" == action) { - LLInventoryObject* first_item = gInventory.getObject(*ids.begin()); if (!first_item) { -- cgit v1.2.3