diff --git a/indra/newview/fsassetblacklist.cpp b/indra/newview/fsassetblacklist.cpp index 092b28fe1b..cb79766de1 100644 --- a/indra/newview/fsassetblacklist.cpp +++ b/indra/newview/fsassetblacklist.cpp @@ -109,7 +109,7 @@ void FSAssetBlacklist::addNewItemToBlacklist(const LLUUID& id, const std::string addNewItemToBlacklistData(id, data, save); } -void FSAssetBlacklist::removeItemFromBlacklist(const LLUUID& id) +void FSAssetBlacklist::removeItem(const LLUUID& id) { gObjectList.removeDerenderedItem(id); @@ -126,7 +126,20 @@ void FSAssetBlacklist::removeItemFromBlacklist(const LLUUID& id) mBlacklistTypeContainer[type].erase(id); mBlacklistData.erase(it); +} +void FSAssetBlacklist::removeItemFromBlacklist(const LLUUID& id) +{ + removeItem(id); + saveBlacklist(); +} + +void FSAssetBlacklist::removeItemsFromBlacklist(const uuid_vec_t& ids) +{ + for (uuid_vec_t::const_iterator it = ids.begin(); it != ids.end(); ++it) + { + removeItem(*it); + } saveBlacklist(); } diff --git a/indra/newview/fsassetblacklist.h b/indra/newview/fsassetblacklist.h index 5e313fb2e8..76033f0130 100644 --- a/indra/newview/fsassetblacklist.h +++ b/indra/newview/fsassetblacklist.h @@ -46,12 +46,14 @@ public: void addNewItemToBlacklist(const LLUUID& id, const std::string& name, const std::string& region, LLAssetType::EType type, bool permanent = true, bool save = true); void addNewItemToBlacklistData(const LLUUID& id, const LLSD& data, bool save = true); void removeItemFromBlacklist(const LLUUID& id); + void removeItemsFromBlacklist(const uuid_vec_t& ids); + void saveBlacklist(); blacklist_data_t getBlacklistData() const { return mBlacklistData; }; private: void loadBlacklist(); - void saveBlacklist(); + void removeItem(const LLUUID& id); bool addEntryToBlacklistMap(const LLUUID& id, LLAssetType::EType type); std::string mBlacklistFileName; diff --git a/indra/newview/fsfloaterassetblacklist.cpp b/indra/newview/fsfloaterassetblacklist.cpp index 17e449357a..3d5df43543 100644 --- a/indra/newview/fsfloaterassetblacklist.cpp +++ b/indra/newview/fsfloaterassetblacklist.cpp @@ -141,14 +141,15 @@ void FSFloaterAssetBlacklist::addElementToList(const LLUUID& id, const LLSD& dat void FSFloaterAssetBlacklist::removeElements() { + uuid_vec_t items; std::vector list = mResultList->getAllSelected(); - FSAssetBlacklist& instance = FSAssetBlacklist::instance(); for (std::vector::const_iterator it = list.begin(); it != list.end(); ++it) { - instance.removeItemFromBlacklist((*it)->getUUID()); + items.push_back((*it)->getUUID()); } - + + FSAssetBlacklist::instance().removeItemsFromBlacklist(items); mResultList->deleteSelectedItems(); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index faf878739e..9c9482050c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2859,6 +2859,7 @@ void cleanup_menus() // FIRE-6970/FIRE-6998: Optional permanent derendering of multiple objects void derenderObject(bool permanent) { + bool need_save = false; LLViewerObject* objp; LLSelectMgr* select_mgr = LLSelectMgr::getInstance(); @@ -2883,6 +2884,7 @@ void derenderObject(bool permanent) } else { + bool next_object = false; LLViewerObject::child_list_t object_children = objp->getChildren(); for (LLViewerObject::child_list_t::const_iterator it = object_children.begin(); it != object_children.end(); it++) { @@ -2893,16 +2895,21 @@ void derenderObject(bool permanent) { // RLVa: Prevent cheating out of sitting by derendering the object select_mgr->deselectObjectOnly(objp); - return; + next_object = true; } else { gAgent.standUp(); - break; } + break; } } + if (next_object) + { + continue; + } + LLSelectNode* nodep = select_mgr->getSelection()->getFirstRootNode(); if (nodep) { @@ -2919,15 +2926,16 @@ void derenderObject(bool permanent) asset_type = LLAssetType::AT_OBJECT; } - FSAssetBlacklist::getInstance()->addNewItemToBlacklist(objp->getID(), entry_name, region_name, asset_type, permanent, permanent); + FSAssetBlacklist::getInstance()->addNewItemToBlacklist(objp->getID(), entry_name, region_name, asset_type, permanent, false); + + if (permanent) + { + need_save = true; + } select_mgr->deselectObjectOnly(objp); - - // Pass true to make sure this object stays dead. - // gObjectList.killObject(objp); - gObjectList.addDerenderedItem( objp->getID(), permanent ); + gObjectList.addDerenderedItem(objp->getID(), permanent); gObjectList.killObject(objp); - // } else if( (objp) && (gAgentID != objp->getID()) && ((rlv_handler_t::isEnabled()) || (objp->isAttachment()) || (objp->permYouOwner())) ) { @@ -2935,6 +2943,11 @@ void derenderObject(bool permanent) return; } } + + if (need_save) + { + FSAssetBlacklist::getInstance()->saveBlacklist(); + } } class LLObjectDerenderPermanent : public view_listener_t