Revert "THE BIGGIE."
This reverts commit ec55705bdd.
Conflicts:
indra/newview/ascentprefsvan.cpp
indra/newview/llinventorybridge.cpp
indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml
This commit is contained in:
@@ -44,7 +44,6 @@
|
||||
#include "llimview.h"
|
||||
#include "llgesturemgr.h"
|
||||
|
||||
#include "llinventorybridge.h"
|
||||
#include "llinventoryview.h"
|
||||
|
||||
#include "llviewerregion.h"
|
||||
@@ -673,10 +672,9 @@ void WearOnAvatarCallback::fire(const LLUUID& inv_item)
|
||||
}
|
||||
}
|
||||
|
||||
RezAttachmentCallback::RezAttachmentCallback(LLViewerJointAttachment *attachmentp, bool replace)
|
||||
RezAttachmentCallback::RezAttachmentCallback(LLViewerJointAttachment *attachmentp)
|
||||
{
|
||||
mAttach = attachmentp;
|
||||
mReplace = replace;
|
||||
}
|
||||
RezAttachmentCallback::~RezAttachmentCallback()
|
||||
{
|
||||
@@ -690,7 +688,7 @@ void RezAttachmentCallback::fire(const LLUUID& inv_item)
|
||||
LLViewerInventoryItem *item = gInventory.getItem(inv_item);
|
||||
if (item)
|
||||
{
|
||||
rez_attachment(item, mAttach, mReplace);
|
||||
rez_attachment(item, mAttach);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -774,72 +772,6 @@ void copy_inventory_item(
|
||||
gAgent.sendReliableMessage();
|
||||
}
|
||||
|
||||
void link_inventory_item(
|
||||
const LLUUID& agent_id,
|
||||
const LLUUID& item_id,
|
||||
const LLUUID& parent_id,
|
||||
const std::string& new_name,
|
||||
const LLAssetType::EType asset_type,
|
||||
LLPointer<LLInventoryCallback> cb)
|
||||
{
|
||||
const LLInventoryObject *baseobj = gInventory.getObject(item_id);
|
||||
if (!baseobj)
|
||||
{
|
||||
llwarns << "attempt to link to unknown item, linked-to-item's itemID " << item_id << llendl;
|
||||
return;
|
||||
}
|
||||
if (baseobj && baseobj->getIsLinkType())
|
||||
{
|
||||
llwarns << "attempt to create a link to a link, linked-to-item's itemID " << item_id << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (baseobj && !LLAssetType::lookupCanLink(baseobj->getType()))
|
||||
{
|
||||
// Fail if item can be found but is of a type that can't be linked.
|
||||
// Arguably should fail if the item can't be found too, but that could
|
||||
// be a larger behavioral change.
|
||||
llwarns << "attempt to link an unlinkable item, type = " << baseobj->getActualType() << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
LLUUID transaction_id;
|
||||
std::string desc = "Broken link"; // This should only show if the object can't find its baseobj.
|
||||
LLInventoryType::EType inv_type = LLInventoryType::IT_NONE;
|
||||
if (dynamic_cast<const LLInventoryCategory *>(baseobj))
|
||||
{
|
||||
inv_type = LLInventoryType::IT_CATEGORY;
|
||||
}
|
||||
else
|
||||
{
|
||||
const LLViewerInventoryItem *baseitem = dynamic_cast<const LLViewerInventoryItem *>(baseobj);
|
||||
if (baseitem)
|
||||
{
|
||||
inv_type = baseitem->getInventoryType();
|
||||
}
|
||||
}
|
||||
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_LinkInventoryItem);
|
||||
msg->nextBlock(_PREHASH_AgentData);
|
||||
{
|
||||
msg->addUUIDFast(_PREHASH_AgentID, agent_id);
|
||||
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
|
||||
}
|
||||
msg->nextBlock(_PREHASH_InventoryBlock);
|
||||
{
|
||||
msg->addU32Fast(_PREHASH_CallbackID, gInventoryCallbacks.registerCB(cb));
|
||||
msg->addUUIDFast(_PREHASH_FolderID, parent_id);
|
||||
msg->addUUIDFast(_PREHASH_TransactionID, transaction_id);
|
||||
msg->addUUIDFast(_PREHASH_OldItemID, item_id);
|
||||
msg->addS8Fast(_PREHASH_Type, (S8)asset_type);
|
||||
msg->addS8Fast(_PREHASH_InvType, (S8)inv_type);
|
||||
msg->addStringFast(_PREHASH_Name, new_name);
|
||||
msg->addStringFast(_PREHASH_Description, desc);
|
||||
}
|
||||
gAgent.sendReliableMessage();
|
||||
}
|
||||
|
||||
void move_inventory_item(
|
||||
const LLUUID& agent_id,
|
||||
const LLUUID& session_id,
|
||||
@@ -914,139 +846,3 @@ void copy_inventory_from_notecard(const LLUUID& object_id, const LLUUID& notecar
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LLAssetType::EType LLViewerInventoryItem::getType() const
|
||||
{
|
||||
if (const LLViewerInventoryItem *linked_item = getLinkedItem())
|
||||
{
|
||||
return linked_item->getType();
|
||||
}
|
||||
if (const LLViewerInventoryCategory *linked_category = getLinkedCategory())
|
||||
{
|
||||
return linked_category->getType();
|
||||
}
|
||||
return LLInventoryItem::getType();
|
||||
}
|
||||
|
||||
const LLUUID& LLViewerInventoryItem::getAssetUUID() const
|
||||
{
|
||||
if (const LLViewerInventoryItem *linked_item = getLinkedItem())
|
||||
{
|
||||
return linked_item->getAssetUUID();
|
||||
}
|
||||
|
||||
return LLInventoryItem::getAssetUUID();
|
||||
}
|
||||
|
||||
const std::string& LLViewerInventoryItem::getName() const
|
||||
{
|
||||
if (const LLViewerInventoryItem *linked_item = getLinkedItem())
|
||||
{
|
||||
return linked_item->getName();
|
||||
}
|
||||
if (const LLViewerInventoryCategory *linked_category = getLinkedCategory())
|
||||
{
|
||||
return linked_category->getName();
|
||||
}
|
||||
|
||||
return LLInventoryItem::getName();
|
||||
}
|
||||
|
||||
const LLPermissions& LLViewerInventoryItem::getPermissions() const
|
||||
{
|
||||
// Use the actual permissions of the symlink, not its parent.
|
||||
return LLInventoryItem::getPermissions();
|
||||
}
|
||||
|
||||
const LLUUID& LLViewerInventoryItem::getCreatorUUID() const
|
||||
{
|
||||
if (const LLViewerInventoryItem *linked_item = getLinkedItem())
|
||||
{
|
||||
return linked_item->getCreatorUUID();
|
||||
}
|
||||
|
||||
return LLInventoryItem::getCreatorUUID();
|
||||
}
|
||||
|
||||
const std::string& LLViewerInventoryItem::getDescription() const
|
||||
{
|
||||
if (const LLViewerInventoryItem *linked_item = getLinkedItem())
|
||||
{
|
||||
return linked_item->getDescription();
|
||||
}
|
||||
|
||||
return LLInventoryItem::getDescription();
|
||||
}
|
||||
|
||||
const LLSaleInfo& LLViewerInventoryItem::getSaleInfo() const
|
||||
{
|
||||
if (const LLViewerInventoryItem *linked_item = getLinkedItem())
|
||||
{
|
||||
return linked_item->getSaleInfo();
|
||||
}
|
||||
|
||||
return LLInventoryItem::getSaleInfo();
|
||||
}
|
||||
|
||||
LLInventoryType::EType LLViewerInventoryItem::getInventoryType() const
|
||||
{
|
||||
if (const LLViewerInventoryItem *linked_item = getLinkedItem())
|
||||
{
|
||||
return linked_item->getInventoryType();
|
||||
}
|
||||
|
||||
// Categories don't have types. If this item is an AT_FOLDER_LINK,
|
||||
// treat it as a category.
|
||||
if (getLinkedCategory())
|
||||
{
|
||||
return LLInventoryType::IT_CATEGORY;
|
||||
}
|
||||
|
||||
return LLInventoryItem::getInventoryType();
|
||||
}
|
||||
|
||||
U32 LLViewerInventoryItem::getFlags() const
|
||||
{
|
||||
if (const LLViewerInventoryItem *linked_item = getLinkedItem())
|
||||
{
|
||||
return linked_item->getFlags();
|
||||
}
|
||||
return LLInventoryItem::getFlags();
|
||||
}
|
||||
|
||||
|
||||
// This returns true if the item that this item points to
|
||||
// doesn't exist in memory (i.e. LLInventoryModel). The baseitem
|
||||
// might still be in the database but just not loaded yet.
|
||||
bool LLViewerInventoryItem::getIsBrokenLink() const
|
||||
{
|
||||
// If the item's type resolves to be a link, that means either:
|
||||
// A. It wasn't able to perform indirection, i.e. the baseobj doesn't exist in memory.
|
||||
// B. It's pointing to another link, which is illegal.
|
||||
return LLAssetType::lookupIsLinkType(getType());
|
||||
}
|
||||
|
||||
LLViewerInventoryItem *LLViewerInventoryItem::getLinkedItem() const
|
||||
{
|
||||
if (mType == LLAssetType::AT_LINK)
|
||||
{
|
||||
LLViewerInventoryItem *linked_item = gInventory.getItem(mAssetUUID);
|
||||
if (linked_item && linked_item->getIsLinkType())
|
||||
{
|
||||
llwarns << "Warning: Accessing link to link" << llendl;
|
||||
return NULL;
|
||||
}
|
||||
return linked_item;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
LLViewerInventoryCategory *LLViewerInventoryItem::getLinkedCategory() const
|
||||
{
|
||||
if (mType == LLAssetType::AT_LINK_FOLDER)
|
||||
{
|
||||
LLViewerInventoryCategory *linked_category = gInventory.getCategory(mAssetUUID);
|
||||
return linked_category;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
Reference in New Issue
Block a user