summaryrefslogtreecommitdiff
path: root/indra/newview/llinventorybridge.cpp
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-05-07 16:33:18 -0400
committerLoren Shih <seraph@lindenlab.com>2010-05-07 16:33:18 -0400
commitf28887554e6d7d6df393ad6335fe9710149000b6 (patch)
tree77193a90449337dc23065423cf39f6696011ae70 /indra/newview/llinventorybridge.cpp
parent0f7d414367f8ab29576ee4e4363e9f618a8badc9 (diff)
EXT-7276: Hide "paste as link" under Debug Setting ("InventoryLinking")
In viewer2.0, paste as link was only allowed in god mode. Here, it is allowable if the user sets a debug setting. This prevents normal users from accidentally screwing up their inventory if they don't understand what a link is.
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r--indra/newview/llinventorybridge.cpp56
1 files changed, 36 insertions, 20 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index a979454938..b9b195c89a 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -645,10 +645,13 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
disabled_items.push_back(std::string("Paste"));
}
- items.push_back(std::string("Paste As Link"));
- if (!isClipboardPasteableAsLink() || (flags & FIRST_SELECTED_ITEM) == 0)
+ if (gSavedSettings.getBOOL("InventoryLinking"))
{
- disabled_items.push_back(std::string("Paste As Link"));
+ items.push_back(std::string("Paste As Link"));
+ if (!isClipboardPasteableAsLink() || (flags & FIRST_SELECTED_ITEM) == 0)
+ {
+ disabled_items.push_back(std::string("Paste As Link"));
+ }
}
items.push_back(std::string("Paste Separator"));
@@ -1421,21 +1424,30 @@ BOOL LLItemBridge::removeItem()
LLNotification::Params params("ConfirmItemDeleteHasLinks");
params.functor.function(boost::bind(&LLItemBridge::confirmRemoveItem, this, _1, _2));
- if (!item->getIsLinkType())
- {
- LLInventoryModel::cat_array_t cat_array;
- LLInventoryModel::item_array_t item_array;
- LLLinkedItemIDMatches is_linked_item_match(mUUID);
- gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
- cat_array,
- item_array,
- LLInventoryModel::INCLUDE_TRASH,
- is_linked_item_match);
- U32 num_links = cat_array.size() + item_array.size();
- if (num_links > 0)
- {
- LLNotifications::instance().add(params);
- return FALSE;
+ // Check if this item has any links. If generic inventory linking is enabled,
+ // we can't do this check because we may have items in a folder somewhere that is
+ // not yet in memory, so we don't want false negatives. (If disabled, then we
+ // know we only have links in the Outfits folder which we explicitly fetch.)
+ if (!gSavedSettings.getBOOL("InventoryLinking"))
+ {
+ if (!item->getIsLinkType())
+ {
+ LLInventoryModel::cat_array_t cat_array;
+ LLInventoryModel::item_array_t item_array;
+ LLLinkedItemIDMatches is_linked_item_match(mUUID);
+ gInventory.collectDescendentsIf(gInventory.getRootFolderID(),
+ cat_array,
+ item_array,
+ LLInventoryModel::INCLUDE_TRASH,
+ is_linked_item_match);
+
+ const U32 num_links = cat_array.size() + item_array.size();
+ if (num_links > 0)
+ {
+ // Warn if the user is will break any links when deleting this item.
+ LLNotifications::instance().add(params);
+ return FALSE;
+ }
}
}
@@ -1628,8 +1640,12 @@ BOOL LLFolderBridge::isUpToDate() const
BOOL LLFolderBridge::isItemCopyable() const
{
- // Can copy folders to paste-as-link, but not for straight paste.
- return TRUE;
+ if (gSavedSettings.getBOOL("InventoryLinking"))
+ {
+ // Can copy folders to paste-as-link, but not for straight paste.
+ return TRUE;
+ }
+ return FALSE;
}
BOOL LLFolderBridge::copyToClipboard() const