From 14a885f8d02a85b7fbbfa646ebfa560dd856c8aa Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Mon, 27 Jan 2014 23:43:16 -0500 Subject: [PATCH] [RLVa] Modernizations License updates, comment updates, settings cleanup, macros cleanup, dead code removal, etc. --- indra/newview/app_settings/settings_rlv.xml | 11 --- indra/newview/llappearancemgr.cpp | 48 ++++++----- indra/newview/llviewermenu.cpp | 47 ++++------ indra/newview/rlvcommon.cpp | 96 +++------------------ indra/newview/rlvcommon.h | 4 +- indra/newview/rlvdefines.h | 27 ++---- indra/newview/rlvextensions.cpp | 9 +- indra/newview/rlvextensions.h | 8 +- indra/newview/rlvhandler.cpp | 25 +++--- indra/newview/rlvhandler.h | 9 +- indra/newview/rlvhelper.cpp | 41 ++++++++- indra/newview/rlvhelper.h | 8 +- indra/newview/rlvinventory.cpp | 6 +- indra/newview/rlvinventory.h | 6 +- indra/newview/rlvlocks.cpp | 24 +++--- indra/newview/rlvlocks.h | 23 +++-- 16 files changed, 167 insertions(+), 225 deletions(-) diff --git a/indra/newview/app_settings/settings_rlv.xml b/indra/newview/app_settings/settings_rlv.xml index 7dd83af41..ca850aaca 100644 --- a/indra/newview/app_settings/settings_rlv.xml +++ b/indra/newview/app_settings/settings_rlv.xml @@ -222,17 +222,6 @@ Value 0 - WarnFirstRLVGiveToRLV - - Comment - Enables FirstRLVGiveToRLV warning dialog - Persist - 1 - Type - Boolean - Value - 1 - ForceInitialCOFDelay Comment diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 9416febb2..9b71c31d8 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -583,7 +583,7 @@ public: void onWearableAssetFetch(LLViewerWearable *wearable); void onAllComplete(); -// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-3.0.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) bool pollStopped(); // [/SL:KB] @@ -670,7 +670,7 @@ void LLWearableHoldingPattern::eraseTypeToRecover(LLWearableType::EType type) mTypesToRecover.erase(type); } -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-06-19 (Catznip-3.0.0a) | Added: Catznip-2.1.2a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-06-19 (Catznip-2.1) //void LLWearableHoldingPattern::setObjItems(const LLInventoryModel::item_array_t& items) //{ // mObjItems = items; @@ -780,10 +780,11 @@ void LLWearableHoldingPattern::onAllComplete() LL_INFOS("Avatar") << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; LLAppearanceMgr::instance().updateAgentWearables(this, false); -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-3.0.0a) | Added: Catznip-2.1.2a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-03-22 (Catznip-2.1) // // Update attachments to match those requested. // if (isAgentAvatarValid()) // { +// LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL; // llinfos << "Updating " << mObjItems.count() << " attachments" << llendl; // LLAgentWearables::userUpdateAttachments(mObjItems); // } @@ -821,7 +822,7 @@ bool LLWearableHoldingPattern::pollFetchCompletion() // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; -// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-3.0.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollStopped, this)); return true; @@ -897,7 +898,7 @@ void recovered_item_cb(const LLUUID& item_id, LLWearableType::EType type, LLView // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; -// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-3.0.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves return; // [/SL:KB] @@ -971,7 +972,7 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() } } -// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-3.0.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) bool LLWearableHoldingPattern::pollStopped() { // We have to keep on polling until we're sure that all callbacks have completed or they'll cause a crash @@ -991,7 +992,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; -// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-3.0.0a) | Added: Catznip-2.0.0a +// [SL:KB] - Patch: Appearance-COFCorruption | Checked: 2010-04-14 (Catznip-2.0) // If we were signalled to stop then we shouldn't do anything else except poll for when it's safe to delete ourselves doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollStopped, this)); return true; @@ -1386,7 +1387,7 @@ bool LLAppearanceMgr::wearItemOnAvatar(const LLUUID& item_id_to_wear, bool do_up if (gInventory.isObjectDescendentOf(item_to_wear->getUUID(), gInventory.getLibraryRootFolderID())) { - LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(&wear_on_avatar_cb,_1,replace)); + LLPointer cb = new LLBoostFuncInventoryCallback(boost::bind(wear_on_avatar_cb,_1,replace)); copy_inventory_item(gAgent.getID(), item_to_wear->getPermissions().getOwner(), item_to_wear->getUUID(), LLUUID::null, std::string(), cb); return false; } @@ -1744,7 +1745,7 @@ bool LLAppearanceMgr::getCanReplaceCOF(const LLUUID& outfit_cat_id) // Check whether it's the base outfit. // if (outfit_cat_id.isNull() || outfit_cat_id == getBaseOutfitUUID()) -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-21 (Catznip-3.0.0a) | Added: Catznip-2.1.2d +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-09-21 (Catznip-2.1) if ( (outfit_cat_id.isNull()) || ((outfit_cat_id == getBaseOutfitUUID()) && (!isOutfitDirty())) ) // [/SL:KB] { @@ -1798,8 +1799,19 @@ void LLAppearanceMgr::purgeCategory(const LLUUID& category, bool keep_outfit_lin continue; if (item->getIsLinkType()) { +#if 0 + if (keep_items && keep_items->find(item) != LLInventoryModel::item_array_t::FAIL) + { + llinfos << "preserved item" << llendl; + } + else + { + gInventory.purgeObject(item->getUUID()); + } +#else gInventory.purgeObject(item->getUUID()); } +#endif } } @@ -1892,9 +1904,8 @@ void LLAppearanceMgr::filterWearableItems( if (size <= 0) continue; // S32 start_index = llmax(0,size-max_per_type); -// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-05-11 (Catznip-3.0.0a) | Added: Catznip-2.0.0h - S32 start_index = - llmax(0, size - ((LLAssetType::AT_BODYPART == LLWearableType::getAssetType((LLWearableType::EType)i)) ? 1 : max_per_type)); +// [SL:KB] - Patch: Appearance-Misc | Checked: 2010-05-11 (Catznip-2.0) + S32 start_index = llmax(0, size - ((LLAssetType::AT_BODYPART == LLWearableType::getAssetType((LLWearableType::EType)i)) ? 1 : max_per_type)); // [/SL:KB[ for (S32 j = start_index; jgetName() : "[UNKNOWN]") << llendl; +// LL_INFOS("Avatar") << self_av_string() << "starting, cat '" << (pcat ? pcat->getName() : "[UNKNOWN]") << "'" << LL_ENDL; // [RLVa:KB] - Checked: 2010-03-26 (RLVa-1.2.0b) | Added: RLVa-1.2.0b // RELEASE-RLVa: [SL-2.0.0] If pcat ever gets used for anything further down the beta we'll know about it llinfos << "starting" << llendl; @@ -2220,8 +2231,6 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo { gAgentWearables.setWearableOutfit(items, wearables, !append); } - -// dec_busy_count(); } static void remove_non_link_items(LLInventoryModel::item_array_t &items) @@ -2334,7 +2343,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); selfStartPhase("update_appearance_from_cof"); - LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; //checking integrity of the COF in terms of ordering of wearables, //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) @@ -2372,7 +2381,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) remove_non_link_items(wear_items); remove_non_link_items(obj_items); remove_non_link_items(gest_items); -// [SL:KB] - Patch: Apperance-Misc | Checked: 2010-11-24 (Catznip-3.0.0a) | Added: Catzip-2.4.0f +// [SL:KB] - Patch: Apperance-Misc | Checked: 2010-11-24 (Catznip-2.4) // Since we're following folder links we might have picked up new duplicates, or exceeded MAX_CLOTHING_PER_TYPE removeDuplicateItems(wear_items); removeDuplicateItems(obj_items); @@ -2387,7 +2396,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) dumpItemArray(wear_items,"asset_dump: wear_item"); dumpItemArray(obj_items,"asset_dump: obj_item"); -// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-3.0.0a) | Added: Catznip-2.2.0a +// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-09-22 (Catznip-2.2) // Update attachments to match those requested. if (isAgentAvatarValid()) { @@ -2704,7 +2713,6 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego void LLAppearanceMgr::wearOutfitByName(const std::string& name) { LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL; - //inc_busy_count(); LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; @@ -3487,7 +3495,7 @@ public: // Error /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) { - llwarns << "appearance update request failed, status: " << status << " reason: " << reason << llendl; + llwarns << "appearance update request failed, status: " << status << " reason: " << reason << " code: " << content["code"].asInteger() << " error: \"" << content["error"].asString() << "\"" << llendl; LL_DEBUGS("Avatar") << "content: " << ll_pretty_print_sd(content) << LL_ENDL; onFailure(status); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 32e426544..b70001718 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -965,15 +965,13 @@ void init_client_menu(LLMenuGL* menu) menu->addChild(sub_menu); // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1b | OK - #ifdef RLV_ADVANCED_MENU - sub_menu = new LLMenuGL("RLVa Embedded"); - init_debug_rlva_menu(sub_menu); - menu->addChild(sub_menu); - // Top Level Menu as well - sub_menu = new LLMenuGL("RLVa Main"); - init_debug_rlva_menu(sub_menu); - gMenuBarView->addChild(sub_menu); - #endif // RLV_ADVANCED_MENU + sub_menu = new LLMenuGL("RLVa Embedded"); + init_debug_rlva_menu(sub_menu); + menu->addChild(sub_menu); + // Top Level Menu as well + sub_menu = new LLMenuGL("RLVa Main"); + init_debug_rlva_menu(sub_menu); + gMenuBarView->addChild(sub_menu); // [/RLVa:KB] sub_menu = new LLMenuGL("UI"); @@ -1100,10 +1098,8 @@ void init_client_menu(LLMenuGL* menu) (void*)"ShowConsoleWindow")); // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e | OK - #ifdef RLV_ADVANCED_TOGGLE_RLVA - if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) - menu->addChild(new LLMenuItemCheckGL("RestrainedLove API", &rlvMenuToggleEnabled, NULL, &rlvMenuCheckEnabled, NULL)); - #endif // RLV_ADVANCED_TOGGLE_RLVA + if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) + menu->addChild(new LLMenuItemCheckGL("RestrainedLove API", &rlvMenuToggleEnabled, NULL, &rlvMenuCheckEnabled, NULL)); // [/RLVa:KB] if(gSavedSettings.getBOOL("QAMode")) @@ -1639,16 +1635,14 @@ void init_debug_rlva_menu(LLMenuGL* menu) menu->addChild(new LLMenuItemCheckGL("Enable Shared Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLESHAREDWEAR)); menu->addSeparator(); - #ifdef RLV_EXTENSION_HIDELOCKED - if ( (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDLAYER)) && - (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDATTACH)) ) - { - menu->addChild(new LLMenuItemCheckGL("Hide Locked Layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); - menu->addChild(new LLMenuItemCheckGL("Hide Locked Attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); - //sub_menu->addChild(new LLMenuItemToggleGL("Hide locked inventory", &rlv_handler_t::fHideLockedInventory)); - menu->addSeparator(); - } - #endif // RLV_EXTENSION_HIDELOCKED + if ( (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDLAYER)) && + (gSavedSettings.controlExists(RLV_SETTING_HIDELOCKEDATTACH)) ) + { + menu->addChild(new LLMenuItemCheckGL("Hide Locked Layers", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDLAYER)); + menu->addChild(new LLMenuItemCheckGL("Hide Locked Attachments", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_HIDELOCKEDATTACH)); + //sub_menu->addChild(new LLMenuItemToggleGL("Hide locked inventory", &rlv_handler_t::fHideLockedInventory)); + menu->addSeparator(); + } if (gSavedSettings.controlExists(RLV_SETTING_FORBIDGIVETORLV)) menu->addChild(new LLMenuItemCheckGL("Forbid Give to #RLV", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_FORBIDGIVETORLV)); @@ -1656,11 +1650,8 @@ void init_debug_rlva_menu(LLMenuGL* menu) menu->addChild(new LLMenuItemCheckGL("Show Name Tags", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_SHOWNAMETAGS)); menu->addSeparator(); - #ifdef RLV_EXTENSION_FLOATER_RESTRICTIONS - // TODO-RLVa: figure out a way to tell if floater_rlv_behaviour.xml exists - menu->addChild(new LLMenuItemCheckGL("Restrictions...", &RlvFloaterBehaviours::toggle, NULL, &RlvFloaterBehaviours::visible, NULL)); - menu->addChild(new LLMenuItemCheckGL("Locks...", &RlvFloaterLocks::toggle, NULL, &RlvFloaterLocks::visible, NULL)); - #endif // RLV_EXTENSION_FLOATER_RESTRICTIONS + menu->addChild(new LLMenuItemCheckGL("Restrictions...", &RlvFloaterBehaviours::toggle, NULL, &RlvFloaterBehaviours::visible, NULL)); + menu->addChild(new LLMenuItemCheckGL("Locks...", &RlvFloaterLocks::toggle, NULL, &RlvFloaterLocks::visible, NULL)); } // [/RLVa:KB] diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index e24c5f3d8..c274daa7e 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -18,6 +18,7 @@ #include "llagent.h" #include "llagentui.h" #include "llavatarnamecache.h" +#include "llinstantmessage.h" #include "llnotificationsutil.h" #include "lluictrlfactory.h" #include "sgversion.h" @@ -37,44 +38,16 @@ #include "../lscript/lscript_byteformat.h" //Need LSCRIPTRunTimePermissionBits and SCRIPT_PERMISSION_* #include -using namespace LLOldEvents; - // ============================================================================ // RlvNotifications // -#ifdef RLV_EXTENSION_NOTIFY_BEHAVIOUR -// Checked: 2009-12-05 (RLVa-1.1.0h) | Added: RLVa-1.1.0h -/*void RlvNotifications::notifyBehaviour(ERlvBehaviour eBhvr, ERlvParamType eType) -{ - const std::string& strMsg = RlvStrings::getBehaviourNotificationString(eBhvr, eType); - if (!strMsg.empty()) - { - LLSD argsNotify; - argsNotify["MESSAGE"] = strMsg; - LLNotificationsUtil::add("SystemMessageTip", argsNotify); - } -}*/ -#endif // RLV_EXTENSION_NOTIFY_BEHAVIOUR - -// Checked: 2009-11-11 (RLVa-1.1.0a) | Added: RLVa-1.1.0a/ -/*void RlvNotifications::notifyBlockedViewXXX(const char* pstrAssetType) -{ - LLStringUtil::format_map_t argsMsg; std::string strMsg = RlvStrings::getString(RLV_STRING_BLOCKED_VIEWXXX); - argsMsg["[TYPE]"] = pstrAssetType; - LLStringUtil::format(strMsg, argsMsg); - - LLSD argsNotify; - argsNotify["MESSAGE"] = strMsg; - LLNotificationsUtil::add("SystemMessageTip", argsNotify); -} -*/ // Checked: 2009-11-13 (RLVa-1.1.0b) | Modified: RLVa-1.1.0b /* void RlvNotifications::warnGiveToRLV() { if ( (gSavedSettings.getWarning(RLV_SETTING_FIRSTUSE_GIVETORLV)) && (RlvSettings::getForbidGiveToRLV()) ) - LLNotifications::instance().add(RLV_SETTING_FIRSTUSE_GIVETORLV, LLSD(), LLSD(), &RlvUtil::onGiveToRLVConfirmation); + LLNotifications::instance().add(RLV_SETTING_FIRSTUSE_GIVETORLV, LLSD(), LLSD(), &RlvNotifications::onGiveToRLVConfirmation); } */ @@ -188,10 +161,6 @@ bool RlvSettings::onChangedSettingBOOL(const LLSD& sdValue, bool* pfSetting) std::vector RlvStrings::m_Anonyms; std::map RlvStrings::m_StringMap; -#ifdef RLV_EXTENSION_NOTIFY_BEHAVIOUR -/*std::map RlvStrings::m_BhvrAddMap; -std::map RlvStrings::m_BhvrRemMap;*/ -#endif // RLV_EXTENSION_NOTIFY_BEHAVIOUR // Checked: 2010-03-09 (RLVa-1.2.0a) | Added: RLVa-1.1.0h void RlvStrings::initClass() @@ -227,25 +196,6 @@ void RlvStrings::initClass() m_Anonyms.push_back(pAnonymNode->getTextContents()); } } - #ifdef RLV_EXTENSION_NOTIFY_BEHAVIOUR - /*else if (pNode->hasName("behaviour-notifications")) - { - std::string strBhvr, strType; ERlvBehaviour eBhvr; - for (LLXMLNode* pNotifyNode = pNode->getFirstChild(); pNotifyNode != NULL; pNotifyNode = pNotifyNode->getNextSibling()) - { - if ( (!pNotifyNode->hasName("notification")) || (!pNotifyNode->getAttributeString("type", strType)) || - (!pNotifyNode->getAttributeString("behaviour", strBhvr)) || - ((eBhvr = RlvCommand::getBehaviourFromString(strBhvr)) == RLV_BHVR_UNKNOWN) ) - { - continue; - } - if ("add" == strType) - m_BhvrAddMap.insert(std::pair(eBhvr, pNotifyNode->getTextContents())); - else if ("rem" == strType) - m_BhvrRemMap.insert(std::pair(eBhvr, pNotifyNode->getTextContents())); - } - }*/ - #endif // RLV_EXTENSION_NOTIFY_BEHAVIOUR } if ( (m_StringMap.empty()) || (m_Anonyms.empty()) ) @@ -270,29 +220,11 @@ const std::string& RlvStrings::getAnonym(const std::string& strName) return m_Anonyms[nHash % m_Anonyms.size()]; } -#ifdef RLV_EXTENSION_NOTIFY_BEHAVIOUR -// Checked: 2009-12-05 (RLVa-1.1.0h) | Added: RLVa-1.1.0h -/*const std::string& RlvStrings::getBehaviourNotificationString(ERlvBehaviour eBhvr, ERlvParamType eType) -{ - if (RLV_TYPE_ADD == eType) - { - std::map::const_iterator itString = m_BhvrAddMap.find(eBhvr); - return (itString != m_BhvrAddMap.end()) ? itString->second : LLStringUtil::null; - } - else if (RLV_TYPE_REMOVE == eType) - { - std::map::const_iterator itString = m_BhvrRemMap.find(eBhvr); - return (itString != m_BhvrRemMap.end()) ? itString->second : LLStringUtil::null; - } - return LLStringUtil::null; -}*/ -#endif // RLV_EXTENSION_NOTIFY_BEHAVIOUR - // Checked: 2009-11-11 (RLVa-1.1.0a) | Added: RLVa-1.1.0a const std::string& RlvStrings::getString(const std::string& strStringName) { static const std::string strMissing = "(Missing RLVa string)"; - string_map_t::const_iterator itString = m_StringMap.find(strStringName); + std::map::const_iterator itString = m_StringMap.find(strStringName); return (itString != m_StringMap.end()) ? itString->second : strMissing; } @@ -396,27 +328,21 @@ void RlvUtil::filterNames(std::string& strUTF8Text, bool fFilterLegacy) LLAvatarName avName; if (LLAvatarNameCache::get(idAgents[idxAgent], &avName)) { - const std::string& strAnonym = RlvStrings::getAnonym(avName.mDisplayName); - - // NOTE: if the legacy first and last name are empty we get a legacy name of " " which would replace all spaces in the string - std::string strLegacyName; - if ( (fFilterLegacy) && (!avName.mLegacyFirstName.empty()) && - ((!avName.mIsDisplayNameDefault) || (LLCacheName::getDefaultLastName() == avName.mLegacyLastName)) ) - { - strLegacyName = avName.getLegacyName(); - } + const std::string& strDisplayName = avName.mDisplayName; + const std::string& strLegacyName = avName.getLegacyName(); + const std::string& strAnonym = RlvStrings::getAnonym(avName); // If the display name is a subset of the legacy name we need to filter that first, otherwise it's the other way around - if (boost::icontains(strLegacyName, avName.mDisplayName)) + if (boost::icontains(strLegacyName, strDisplayName)) { - if (!strLegacyName.empty()) + if (fFilterLegacy) boost::ireplace_all(strUTF8Text, strLegacyName, strAnonym); - boost::ireplace_all(strUTF8Text, avName.mDisplayName, strAnonym); + boost::ireplace_all(strUTF8Text, strDisplayName, strAnonym); } else { - boost::ireplace_all(strUTF8Text, avName.mDisplayName, strAnonym); - if (!strLegacyName.empty()) + boost::ireplace_all(strUTF8Text, strDisplayName, strAnonym); + if (fFilterLegacy) boost::ireplace_all(strUTF8Text, strLegacyName, strAnonym); } } diff --git a/indra/newview/rlvcommon.h b/indra/newview/rlvcommon.h index a767ed445..a0d5b1c8d 100644 --- a/indra/newview/rlvcommon.h +++ b/indra/newview/rlvcommon.h @@ -46,6 +46,7 @@ class LLInventoryItem; class LLViewerInventoryCategory; class LLViewerInventoryItem; class LLViewerJointAttachment; +class LLViewerWearable; class LLWearable; // @@ -141,8 +142,7 @@ public: protected: static std::vector m_Anonyms; - typedef std::map string_map_t; - static string_map_t m_StringMap; + static std::map m_StringMap; }; // ============================================================================ diff --git a/indra/newview/rlvdefines.h b/indra/newview/rlvdefines.h index 9e000ddbd..58bf384c8 100644 --- a/indra/newview/rlvdefines.h +++ b/indra/newview/rlvdefines.h @@ -3,10 +3,10 @@ * Copyright (c) 2009-2011, Kitty Barnett * * The source code in this file is provided to you under the terms of the - * GNU General Public License, version 2.0, but WITHOUT ANY WARRANTY; + * GNU Lesser General Public License, version 2.1, but WITHOUT ANY WARRANTY; * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. Terms of the GPL can be found in doc/GPL-license.txt - * in this distribution, or online at http://www.gnu.org/licenses/gpl-2.0.txt + * PARTICULAR PURPOSE. Terms of the LGPL can be found in doc/LGPL-licence.txt + * in this distribution, or online at http://www.gnu.org/licenses/lgpl-2.1.txt * * By copying, modifying or distributing this software, you acknowledge that * you have read and understood your obligations described above, and agree to @@ -21,20 +21,10 @@ // Extensions // -// Comment out if you don't want the Advanced / RLVa menu (may prevent enabling some extensions or experimental features - see below) -#define RLV_ADVANCED_MENU -// Comment out if you provide your own way to enable/disable RLVa -#define RLV_ADVANCED_TOGGLE_RLVA - -// Provides access to "advanced" features through the RLVa debug menu -#define RLV_EXTENSION_FLOATER_RESTRICTIONS // Enables the Advanced / RLVa / Restrictions... floater -#define RLV_EXTENSION_HIDELOCKED // "Hide locked layers", "Hide locked attachments" and "Hide locked inventory" - // Extensions #define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx #define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders: