From 09bcc26ecdbfc9066272bda163e9f46872140d0d Mon Sep 17 00:00:00 2001 From: Tonya Souther Date: Sun, 4 Sep 2011 21:45:58 -0500 Subject: [PATCH] Don't create links to the bridge when saving an outfit. Partial fix for FIRE-1474. --- indra/newview/fslslbridge.cpp | 1 + indra/newview/llappearancemgr.cpp | 43 ++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/indra/newview/fslslbridge.cpp b/indra/newview/fslslbridge.cpp index 7a2cac1e79..d9be0dae64 100644 --- a/indra/newview/fslslbridge.cpp +++ b/indra/newview/fslslbridge.cpp @@ -60,6 +60,7 @@ //#define ROOT_FIRESTORM_FOLDER "#Firestorm" //moved to llinventoryfunctions to synch with the AO object #define FS_BRIDGE_FOLDER "#LSL Bridge" +// If you change this, change it in llappearancemgr.cpp too. -- TS #define FS_BRIDGE_NAME "#Firestorm LSL Bridge v" #define FS_BRIDGE_MAJOR_VERSION 1 #define FS_BRIDGE_MINOR_VERSION 7 diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 7243355e10..940047c80a 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -58,6 +58,10 @@ #include "fslslbridge.h" //-TT +// Firestorm bridge name prefix. MUST correspond to the same variable in +// fslslbridge.cpp. -- TS +#define FS_BRIDGE_NAME "#Firestorm LSL Bridge v" + // RAII thingy to guarantee that a variable gets reset when the Setter // goes out of scope. More general utility would be handy - TODO: // check boost. @@ -1260,18 +1264,24 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL ++iter) { const LLViewerInventoryItem* item = (*iter); + std::string item_name = item->getName(); + size_t bridge_name_len = sizeof(FS_BRIDGE_NAME) - 1; switch (item->getActualType()) { case LLAssetType::AT_LINK: { - //LLInventoryItem::getDescription() is used for a new description - //to propagate ordering information saved in descriptions of links - link_inventory_item(gAgent.getID(), - item->getLinkedUUID(), - dst_id, - item->getName(), - item->LLInventoryItem::getDescription(), - LLAssetType::AT_LINK, cb); + if (item_name.substr(0,bridge_name_len) != FS_BRIDGE_NAME) + { + llinfos << "copying inventory link " << item_name << llendl; + //LLInventoryItem::getDescription() is used for a new description + //to propagate ordering information saved in descriptions of links + link_inventory_item(gAgent.getID(), + item->getLinkedUUID(), + dst_id, + item->getName(), + item->LLInventoryItem::getDescription(), + LLAssetType::AT_LINK, cb); + } break; } case LLAssetType::AT_LINK_FOLDER: @@ -1294,13 +1304,16 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL case LLAssetType::AT_BODYPART: case LLAssetType::AT_GESTURE: { - llinfos << "copying inventory item " << item->getName() << llendl; - copy_inventory_item(gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - dst_id, - item->getName(), - cb); + if (item_name.substr(0,bridge_name_len) != FS_BRIDGE_NAME) + { + llinfos << "copying inventory item " << item_name << llendl; + copy_inventory_item(gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + dst_id, + item_name, + cb); + } break; } default: