Rip out the globals :D
This commit is contained in:
@@ -263,12 +263,6 @@ LLTimer gLogoutTimer;
|
||||
static const F32 LOGOUT_REQUEST_TIME = 6.f; // this will be cut short by the LogoutReply msg.
|
||||
F32 gLogoutMaxTime = LOGOUT_REQUEST_TIME;
|
||||
|
||||
// <edit>
|
||||
LLUUID gSystemFolderRoot;
|
||||
LLUUID gSystemFolderSettings;
|
||||
LLUUID gSystemFolderAssets;
|
||||
// </edit>
|
||||
|
||||
BOOL gDisconnected = FALSE;
|
||||
|
||||
// used to restore texture state after a mode switch
|
||||
|
||||
@@ -321,12 +321,6 @@ extern LLTimer gLogoutTimer;
|
||||
extern F32 gSimLastTime;
|
||||
extern F32 gSimFrames;
|
||||
|
||||
// <edit>
|
||||
extern LLUUID gSystemFolderRoot;
|
||||
extern LLUUID gSystemFolderSettings;
|
||||
extern LLUUID gSystemFolderAssets;
|
||||
// </edit>
|
||||
|
||||
extern BOOL gDisconnected;
|
||||
|
||||
extern LLFrameTimer gRestoreGLTimer;
|
||||
|
||||
@@ -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));
|
||||
|
||||
|
||||
@@ -1777,10 +1777,6 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const
|
||||
}
|
||||
}
|
||||
|
||||
// <edit>
|
||||
if((cat_id == gSystemFolderRoot) || gInventory.isObjectDescendentOf(cat_id, gSystemFolderRoot)) return true;
|
||||
// </edit>
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1512,10 +1512,9 @@ EAcceptance LLToolDragAndDrop::willObjectAcceptInventory(LLViewerObject* obj, LL
|
||||
if(!item || !obj) return ACCEPT_NO;
|
||||
// HACK: downcast
|
||||
LLViewerInventoryItem* vitem = (LLViewerInventoryItem*)item;
|
||||
// <edit>
|
||||
//if(!vitem->isFinished()) return ACCEPT_NO;
|
||||
if(!vitem->isFinished() && !(gInventory.isObjectDescendentOf(vitem->getUUID(), gSystemFolderRoot))) return ACCEPT_NO;
|
||||
// </edit>
|
||||
|
||||
if(!vitem->isFinished()) return ACCEPT_NO;
|
||||
|
||||
if (vitem->getIsLinkType()) return ACCEPT_NO; // No giving away links
|
||||
|
||||
// deny attempts to drop from an object onto itself. This is to
|
||||
@@ -1980,10 +1979,9 @@ EAcceptance LLToolDragAndDrop::dad3dApplyToObject(
|
||||
LLViewerInventoryItem* item;
|
||||
LLViewerInventoryCategory* cat;
|
||||
locateInventory(item, cat);
|
||||
// <edit>
|
||||
//if(!item || !item->isFinished()) return ACCEPT_NO;
|
||||
if( !item || (!item->isFinished() && !(gInventory.isObjectDescendentOf(item->getUUID(), gSystemFolderRoot))) ) return ACCEPT_NO;
|
||||
// </edit>
|
||||
|
||||
if(!item || !item->isFinished()) return ACCEPT_NO;
|
||||
|
||||
EAcceptance rv = willObjectAcceptInventory(obj, item);
|
||||
if((mask & MASK_CONTROL))
|
||||
{
|
||||
|
||||
@@ -293,9 +293,6 @@ void LLViewerInventoryItem::cloneViewerItem(LLPointer<LLViewerInventoryItem>& ne
|
||||
|
||||
void LLViewerInventoryItem::removeFromServer()
|
||||
{
|
||||
// <edit> this check is ghetto
|
||||
if((mParentUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))) return;
|
||||
// </edit>
|
||||
lldebugs << "Removing inventory item " << mUUID << " from server."
|
||||
<< llendl;
|
||||
|
||||
@@ -314,9 +311,6 @@ void LLViewerInventoryItem::removeFromServer()
|
||||
|
||||
void LLViewerInventoryItem::updateServer(BOOL is_new) const
|
||||
{
|
||||
// <edit>
|
||||
if((mParentUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))) return;
|
||||
// </edit>
|
||||
if(!mIsComplete)
|
||||
{
|
||||
// *FIX: deal with this better.
|
||||
@@ -492,9 +486,6 @@ bool LLViewerInventoryItem::exportFileLocal(LLFILE* fp) const
|
||||
|
||||
void LLViewerInventoryItem::updateParentOnServer(BOOL restamp) const
|
||||
{
|
||||
// <edit>
|
||||
if(gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot)) return;
|
||||
// </edit>
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_MoveInventoryItem);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
@@ -564,9 +555,6 @@ void LLViewerInventoryCategory::copyViewerCategory(const LLViewerInventoryCatego
|
||||
|
||||
void LLViewerInventoryCategory::updateParentOnServer(BOOL restamp) const
|
||||
{
|
||||
// <edit>
|
||||
if(gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot)) return;
|
||||
// </edit>
|
||||
LLMessageSystem* msg = gMessageSystem;
|
||||
msg->newMessageFast(_PREHASH_MoveInventoryFolder);
|
||||
msg->nextBlockFast(_PREHASH_AgentData);
|
||||
@@ -631,9 +619,6 @@ void LLViewerInventoryCategory::removeFromServer( void )
|
||||
|
||||
bool LLViewerInventoryCategory::fetch()
|
||||
{
|
||||
// <edit>
|
||||
if((mUUID == gSystemFolderRoot) || (gInventory.isObjectDescendentOf(mUUID, gSystemFolderRoot))) return false;
|
||||
// </edit>
|
||||
if((VERSION_UNKNOWN == getVersion()) &&
|
||||
(!mDescendentsRequested.getStarted() ||
|
||||
mDescendentsRequested.hasExpired())) //Expired check prevents multiple downloads.
|
||||
|
||||
Reference in New Issue
Block a user