Rip out the globals :D

This commit is contained in:
Drake Arconis
2013-06-18 01:03:27 -04:00
parent 7a0e3d8abd
commit 43a7cbaa85
6 changed files with 41 additions and 134 deletions

View File

@@ -88,8 +88,6 @@
#include "rlvlocks.h"
// [/RLVa:KB]
extern LLUUID gSystemFolderRoot;
// Marketplace outbox current disabled
#define ENABLE_MERCHANT_OUTBOX_CONTEXT_MENU 1
#define ENABLE_MERCHANT_SEND_TO_MARKETPLACE_CONTEXT_MENU 1
@@ -385,33 +383,26 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
move_ids.push_back(item->getUUID());
--update[item->getParentUUID()];
++update[trash_id];
// <edit>
if(!gInventory.isObjectDescendentOf(item->getUUID(), gSystemFolderRoot))
if(start_new_message)
{
// </edit>
if(start_new_message)
{
start_new_message = false;
msg->newMessageFast(_PREHASH_MoveInventoryItem);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addBOOLFast(_PREHASH_Stamp, TRUE);
}
msg->nextBlockFast(_PREHASH_InventoryData);
msg->addUUIDFast(_PREHASH_ItemID, item->getUUID());
msg->addUUIDFast(_PREHASH_FolderID, trash_id);
msg->addString("NewName", NULL);
if(msg->isSendFullFast(_PREHASH_InventoryData))
{
start_new_message = true;
gAgent.sendReliableMessage();
gInventory.accountForUpdate(update);
update.clear();
}
// <edit>
start_new_message = false;
msg->newMessageFast(_PREHASH_MoveInventoryItem);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addBOOLFast(_PREHASH_Stamp, TRUE);
}
msg->nextBlockFast(_PREHASH_InventoryData);
msg->addUUIDFast(_PREHASH_ItemID, item->getUUID());
msg->addUUIDFast(_PREHASH_FolderID, trash_id);
msg->addString("NewName", NULL);
if(msg->isSendFullFast(_PREHASH_InventoryData))
{
start_new_message = true;
gAgent.sendReliableMessage();
gInventory.accountForUpdate(update);
update.clear();
}
// </edit>
}
}
if(!start_new_message)
@@ -433,32 +424,25 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
move_ids.push_back(cat->getUUID());
--update[cat->getParentUUID()];
++update[trash_id];
// <edit>
if(!gInventory.isObjectDescendentOf(cat->getUUID(), gSystemFolderRoot)) //Avoid fake items.
if(start_new_message)
{
// </edit>
if(start_new_message)
{
start_new_message = false;
msg->newMessageFast(_PREHASH_MoveInventoryFolder);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addBOOL("Stamp", TRUE);
}
msg->nextBlockFast(_PREHASH_InventoryData);
msg->addUUIDFast(_PREHASH_FolderID, cat->getUUID());
msg->addUUIDFast(_PREHASH_ParentID, trash_id);
if(msg->isSendFullFast(_PREHASH_InventoryData))
{
start_new_message = true;
gAgent.sendReliableMessage();
gInventory.accountForUpdate(update);
update.clear();
}
// <edit>
start_new_message = false;
msg->newMessageFast(_PREHASH_MoveInventoryFolder);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->addBOOL("Stamp", TRUE);
}
msg->nextBlockFast(_PREHASH_InventoryData);
msg->addUUIDFast(_PREHASH_FolderID, cat->getUUID());
msg->addUUIDFast(_PREHASH_ParentID, trash_id);
if(msg->isSendFullFast(_PREHASH_InventoryData))
{
start_new_message = true;
gAgent.sendReliableMessage();
gInventory.accountForUpdate(update);
update.clear();
}
// </edit>
}
}
if(!start_new_message)
@@ -472,37 +456,6 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener*
uuid_vec_t::iterator end = move_ids.end();
for(; it != end; ++it)
{
// <edit> trash problem
if(gInventory.isObjectDescendentOf(*it, gSystemFolderRoot))
{
// if it's a category, delete descendents
if(gInventory.getCategory(*it))
{
LLViewerInventoryCategory* cat = gInventory.getCategory(*it);
cat->setDescendentCount(0);
LLInventoryModel::cat_array_t categories;
LLInventoryModel::item_array_t items;
gInventory.collectDescendents(cat->getUUID(),
categories,
items,
false); // include trash?
S32 count = items.count();
S32 i;
for(i = 0; i < count; ++i)
{
gInventory.deleteObject(items.get(i)->getUUID());
}
count = categories.count();
for(i = 0; i < count; ++i)
{
gInventory.deleteObject(categories.get(i)->getUUID());
}
}
// delete it
gInventory.deleteObject(*it);
}
else
// </edit>
gInventory.moveObject((*it), trash_id);
}
@@ -1520,9 +1473,6 @@ void LLItemBridge::selectItem()
LLViewerInventoryItem* item = static_cast<LLViewerInventoryItem*>(getItem());
if(item && !item->isFinished())
{
// <edit>
if(!(gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot)))
// </edit>
//item->fetchFromServer();
LLInventoryModelBackgroundFetch::instance().start(item->getUUID(), false);
}
@@ -1794,16 +1744,6 @@ BOOL LLItemBridge::removeItem()
// Already in trash
if (model->isObjectDescendentOf(mUUID, trash_id)) return FALSE;
// <edit> trash problem
if(gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))
{
LLInventoryModel::LLCategoryUpdate up(item->getParentUUID(), -1);
gInventory.deleteObject(mUUID);
gInventory.accountForUpdate(up);
gInventory.notifyObservers();
}
// </edit>
LLNotification::Params params("ConfirmItemDeleteHasLinks");
params.functor(boost::bind(&LLItemBridge::confirmRemoveItem, this, _1, _2));