From 9a085c7895cd86fc0ca5b879018480d9de7da106 Mon Sep 17 00:00:00 2001 From: Hazim Gazov Date: Fri, 23 Apr 2010 07:17:04 -0300 Subject: [PATCH] fixed the last few compiling errors, now onto the linking errors --- indra/newview/llfloaterexploreanimations.cpp | 2 +- indra/newview/llfloaterexploreanimations.h | 2 +- indra/newview/llhudtext.cpp | 16 + indra/newview/llhudtext.h | 3 + indra/newview/llinventorybridge.cpp | 548 ++----------------- 5 files changed, 81 insertions(+), 490 deletions(-) diff --git a/indra/newview/llfloaterexploreanimations.cpp b/indra/newview/llfloaterexploreanimations.cpp index c532562d0..24fc4da54 100644 --- a/indra/newview/llfloaterexploreanimations.cpp +++ b/indra/newview/llfloaterexploreanimations.cpp @@ -12,7 +12,7 @@ #include "llselectmgr.h" // -std::map> LLFloaterExploreAnimations::animHistory; +std::map< LLUUID, std::list< LLAnimHistoryItem* > > LLFloaterExploreAnimations::animHistory; LLFloaterExploreAnimations* LLFloaterExploreAnimations::sInstance; diff --git a/indra/newview/llfloaterexploreanimations.h b/indra/newview/llfloaterexploreanimations.h index c9317f4f8..03b7b0f53 100644 --- a/indra/newview/llfloaterexploreanimations.h +++ b/indra/newview/llfloaterexploreanimations.h @@ -45,7 +45,7 @@ public: static void startAnim(LLUUID avatarid, LLUUID assetid); static void stopAnim(LLUUID avatarid, LLUUID assetid); - static std::map> animHistory; + static std::map< LLUUID, std::list< LLAnimHistoryItem* > > animHistory; static LLFloaterExploreAnimations* sInstance; private: static void handleHistoryChange(); diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index 20140073f..d12853e98 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -691,6 +691,22 @@ void LLHUDText::setDoFade(const BOOL do_fade) mDoFade = do_fade; } +// +std::string LLHUDText::getStringUTF8() +{ + std::string out(""); + int t = mTextSegments.size(); + int i = 0; + for (std::vector::iterator segment_iter = mTextSegments.begin(); + segment_iter != mTextSegments.end(); ++segment_iter ) + { + out.append(wstring_to_utf8str((*segment_iter).getText())); + i++; + if(i < t) out.append("\n"); + } + return out; +} +// void LLHUDText::updateVisibility() { if (mSourceObject) diff --git a/indra/newview/llhudtext.h b/indra/newview/llhudtext.h index 645cbc269..0d775a947 100644 --- a/indra/newview/llhudtext.h +++ b/indra/newview/llhudtext.h @@ -103,6 +103,9 @@ public: void setZCompare(const BOOL zcompare); void setDoFade(const BOOL do_fade); void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } + // + std::string getStringUTF8(); + // // mMaxLines of -1 means unlimited lines. void setMaxLines(S32 max_lines) { mMaxLines = max_lines; } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index dfecc2673..0fe84c09c 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -86,15 +86,8 @@ #include "lluictrlfactory.h" #include "llselectmgr.h" #include "llfloateropenobject.h" -// -#include "llappviewer.h" // gLocalInventoryRoot -#include "llfloateranimpreview.h" // for reuploads -#include "llfloaterimagepreview.h" // for reuploads -#include "llimportobject.h" // for disabling options during import -//#include "llcheats.h" #include "dofloaterhex.h" #include "hgfloatertexteditor.h" -// // Helpers // bug in busy count inc/dec right now, logic is complex... do we really need it? @@ -120,20 +113,7 @@ void wear_inventory_category_on_avatar_step3(LLWearableHoldingPattern* holder, B void remove_inventory_category_from_avatar(LLInventoryCategory* category); void remove_inventory_category_from_avatar_step2( BOOL proceed, void* userdata); bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, LLMoveInv*); -void confirm_replace_attachment_rez(S32 option, void* user_data); -// -void gotImageForSaveItemAs(BOOL success, - LLViewerImage *src_vi, - LLImageRaw* src, - LLImageRaw* aux_src, - S32 discard_level, - BOOL final, - void* userdata); -void gotAssetForSaveItemAs(LLVFS *vfs, - const LLUUID& asset_uuid, - LLAssetType::EType type, - void* user_data, S32 status, LLExtStat ext_status); -// +bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response); std::string ICON_NAME[ICON_NAME_COUNT] = { @@ -212,24 +192,13 @@ time_t LLInvFVBridge::getCreationDate() const // Can be destoryed (or moved to trash) BOOL LLInvFVBridge::isItemRemovable() { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; - // - //if(model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID())) - //{ - // return TRUE; - //} - // - //return FALSE; + if(model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID())) + { return TRUE; - // + } + return FALSE; } // Can be moved to another folder @@ -246,13 +215,6 @@ void LLInvFVBridge::showProperties() void LLInvFVBridge::removeBatch(LLDynamicArray& batch) { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // // Deactivate gestures when moving them into Trash LLInvFVBridge* bridge; LLInventoryModel* model = mInventoryPanel->getModel(); @@ -297,13 +259,6 @@ void LLInvFVBridge::removeBatch(LLDynamicArray& batc void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray& batch) { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // // this method moves a bunch of items and folders to the trash. As // per design guidelines for the inventory model, the message is // built and the accounting is performed first. After all of that, @@ -321,18 +276,6 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray close floaters first - for(i = 0; i < count; ++i) - { - bridge = (LLInvFVBridge*)(batch.get(i)); - if(!bridge || !bridge->isItemRemovable()) continue; - item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); - if(item) - { - LLPreview::hide(item->getUUID()); - } - } - // for(i = 0; i < count; ++i) { bridge = (LLInvFVBridge*)(batch.get(i)); @@ -342,38 +285,29 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArraygetParentUUID() == trash_id) continue; move_ids.push_back(item->getUUID()); - // don't do stuff that messes with gMessageSystem - //LLPreview::hide(item->getUUID()); - // + LLPreview::hide(item->getUUID()); --update[item->getParentUUID()]; ++update[trash_id]; - // - if(!gInventory.isObjectDescendentOf(item->getUUID(), gLocalInventoryRoot)) + if(start_new_message) { - // - 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(); - } - // + 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(); } - // } } if(!start_new_message) @@ -394,32 +328,25 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArraygetUUID()); --update[cat->getParentUUID()]; ++update[trash_id]; - // - if(!gInventory.isObjectDescendentOf(cat->getUUID(), gLocalInventoryRoot)) + if(start_new_message) { - // - 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(); - } - // + 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(); } - // } } if(!start_new_message) @@ -433,37 +360,6 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray::iterator end = move_ids.end(); for(; it != end; ++it) { - // trash problem - if(gInventory.isObjectDescendentOf(*it, gLocalInventoryRoot)) - { - // 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 - // gInventory.moveObject((*it), trash_id); } @@ -473,13 +369,6 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; BOOL is_agent_inventory = model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID()); @@ -550,22 +439,13 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, std::vector - /* - // if ( (! ( isItemPermissive() || gAgent.isGodlike() ) ) || (flags & FIRST_SELECTED_ITEM) == 0) { disabled_items.push_back(std::string("Copy Asset UUID")); } - // - */ - // } - // - //items.push_back(std::string("Magic Get")); - //items.push_back(std::string("Rez")); items.push_back(std::string("Open With...")); items.push_back(std::string("Copy Separator")); @@ -647,13 +527,6 @@ BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const LLInventoryObject* LLInvFVBridge::getInventoryObject() const { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return NULL; - } - // LLInventoryObject* obj = NULL; LLInventoryModel* model = mInventoryPanel->getModel(); if(model) @@ -665,13 +538,6 @@ LLInventoryObject* LLInvFVBridge::getInventoryObject() const BOOL LLInvFVBridge::isInTrash() const { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); @@ -680,13 +546,6 @@ BOOL LLInvFVBridge::isInTrash() const BOOL LLInvFVBridge::isAgentInventory() const { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; if(gAgent.getInventoryRootID() == mUUID) return TRUE; @@ -704,9 +563,6 @@ void LLInvFVBridge::changeItemParent(LLInventoryModel* model, const LLUUID& new_parent, BOOL restamp) { - // - bool send_parent_update = gInventory.isObjectDescendentOf(item->getUUID(), gAgent.getInventoryRootID()); - // if(item->getParentUUID() != new_parent) { LLInventoryModel::update_list_t update; @@ -718,9 +574,6 @@ void LLInvFVBridge::changeItemParent(LLInventoryModel* model, LLPointer new_item = new LLViewerInventoryItem(item); new_item->setParent(new_parent); - // - if(send_parent_update) - // new_item->updateParentOnServer(restamp); model->updateItem(new_item); model->notifyObservers(); @@ -969,22 +822,12 @@ void LLItemBridge::selectItem() LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem(); if(item && !item->isComplete()) { - // - if(!(gInventory.isObjectDescendentOf(mUUID, gLocalInventoryRoot))) - // item->fetchFromServer(); } } void LLItemBridge::restoreItem() { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLViewerInventoryItem* item = (LLViewerInventoryItem*)getItem(); if(item) { @@ -1088,11 +931,8 @@ std::string LLItemBridge::getLabelSuffix() const if(item) { // it's a bit confusing to put nocopy/nomod/etc on calling cards. - // Not really sheesh - //if(LLAssetType::AT_CALLINGCARD != item->getType() - // && item->getPermissions().getOwner() == gAgent.getID()) - if(item->getPermissions().getOwner() == gAgent.getID()) - // + if(LLAssetType::AT_CALLINGCARD != item->getType() + && item->getPermissions().getOwner() == gAgent.getID()) { BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); @@ -1143,13 +983,6 @@ BOOL LLItemBridge::renameItem(const std::string& new_name) { if(!isItemRenameable()) return FALSE; LLPreview::rename(mUUID, getPrefix() + new_name); - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; LLViewerInventoryItem* item = getItem(); @@ -1176,13 +1009,6 @@ BOOL LLItemBridge::removeItem() } // move it to the trash LLPreview::hide(mUUID, TRUE); - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); @@ -1191,16 +1017,6 @@ BOOL LLItemBridge::removeItem() // if item is not already in trash if(item && !model->isObjectDescendentOf(mUUID, trash_id)) { - // trash problem - if(gInventory.isObjectDescendentOf(mUUID, gLocalInventoryRoot)) - { - LLInventoryModel::LLCategoryUpdate up(item->getParentUUID(), -1); - gInventory.deleteObject(mUUID); - gInventory.accountForUpdate(up); - gInventory.notifyObservers(); - } - else - // // move to trash, and restamp LLInvFVBridge::changeItemParent(model, item, trash_id, TRUE); // delete was successful @@ -1234,13 +1050,6 @@ BOOL LLItemBridge::copyToClipboard() const LLViewerInventoryItem* LLItemBridge::getItem() const { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return NULL; - } - // LLViewerInventoryItem* item = NULL; LLInventoryModel* model = mInventoryPanel->getModel(); if(model) @@ -1289,27 +1098,12 @@ void LLFolderBridge::selectItem() // Can be destroyed (or moved to trash) BOOL LLFolderBridge::isItemRemovable() { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) { return FALSE; } - // - // People delete their inventory easily... - if(mUUID == gAgent.getInventoryRootID()) - { - return FALSE; - } - /* - // if(!model->isObjectDescendentOf(mUUID, gAgent.getInventoryRootID())) { return FALSE; @@ -1366,22 +1160,12 @@ BOOL LLFolderBridge::isItemRemovable() } } } - // - */ - // return TRUE; } BOOL LLFolderBridge::isUpToDate() const { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; LLViewerInventoryCategory* category = (LLViewerInventoryCategory*)model->getCategory(mUUID); @@ -1390,10 +1174,7 @@ BOOL LLFolderBridge::isUpToDate() const return FALSE; } - // trying to make it stop trying to fetch Local Inventory - //return category->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN; - return (category->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) || (mUUID == gLocalInventoryRoot) || (gInventory.isObjectDescendentOf(mUUID, gLocalInventoryRoot)); - // + return category->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN; } BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, @@ -1403,13 +1184,6 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, // the UI will get confused and pass in a NULL. if(!inv_cat) return FALSE; - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; @@ -1859,13 +1633,6 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model } else if ("removefromoutfit" == action) { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return; LLViewerInventoryCategory* cat = getCategory(); @@ -1897,13 +1664,6 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model void LLFolderBridge::openItem() { lldebugs << "LLFolderBridge::openItem()" << llendl; - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return; model->fetchDescendentsOf(mUUID); @@ -1922,13 +1682,6 @@ BOOL LLFolderBridge::isItemRenameable() const void LLFolderBridge::restoreItem() { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLViewerInventoryCategory* cat; cat = (LLViewerInventoryCategory*)getCategory(); if(cat) @@ -2007,13 +1760,6 @@ LLUIImagePtr LLFolderBridge::getIcon() const BOOL LLFolderBridge::renameItem(const std::string& new_name) { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // if(!isItemRenameable()) return FALSE; LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; @@ -2033,21 +1779,12 @@ BOOL LLFolderBridge::renameItem(const std::string& new_name) BOOL LLFolderBridge::removeItem() { - // - //if(!isItemRemovable()) - //{ - // return FALSE; - //} - // - // move it to the trash - LLPreview::hide(mUUID); - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) + if(!isItemRemovable()) { - llwarns << "scheduled for delayed delete" << llendl; return FALSE; } - // + // move it to the trash + LLPreview::hide(mUUID); LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; @@ -2075,41 +1812,6 @@ BOOL LLFolderBridge::removeItem() LLViewerInventoryCategory* cat = getCategory(); if(cat) { - // trash problem - if(gInventory.isObjectDescendentOf(cat->getUUID(), gLocalInventoryRoot)) - { - S32 descendents = cat->getDescendentCount(); - if(descendents > 0) - { - LLInventoryModel::LLCategoryUpdate up(cat->getUUID(), -descendents); - gInventory.accountForUpdate(up); - } - 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()); - } - - LLInventoryModel::LLCategoryUpdate up(cat->getParentUUID(), -descendents); - gInventory.deleteObject(cat->getUUID()); - gInventory.accountForUpdate(up); - gInventory.notifyObservers(); - } - else - // LLInvFVBridge::changeCategoryParent(model, cat, trash_id, TRUE); } @@ -2127,13 +1829,6 @@ BOOL LLFolderBridge::isClipboardPasteable() const void LLFolderBridge::pasteFromClipboard() { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(model && isClipboardPasteable()) { @@ -2171,13 +1866,6 @@ void LLFolderBridge::folderOptionsMenu() // *TODO: Translate - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return; @@ -2215,15 +1903,8 @@ void LLFolderBridge::folderOptionsMenu() // Only enable add/replace outfit for non-default folders. if (!is_default_folder) { - // don't allow attaching stuff during attachment import - if(!(LLXmlImport::sImportInProgress && LLXmlImport::sImportHasAttachments)) - { - // - mItems.push_back(std::string("Add To Outfit")); - mItems.push_back(std::string("Replace Outfit")); - // - } - // + mItems.push_back(std::string("Add To Outfit")); + mItems.push_back(std::string("Replace Outfit")); } mItems.push_back(std::string("Take Off Items")); } @@ -2248,13 +1929,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // *TODO: Translate lldebugs << "LLFolderBridge::buildContextMenu()" << llendl; // std::vector disabled_items; - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return; LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); @@ -2362,25 +2036,14 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) } else { - // - //mItems.push_back(std::string("--no options--")); - //mDisabledItems.push_back(std::string("--no options--")); - mItems.push_back(std::string("Save As...")); - mItems.push_back(std::string("Save InvCache...")); - // + mItems.push_back(std::string("--no options--")); + mDisabledItems.push_back(std::string("--no options--")); } hideContextEntries(menu, mItems, mDisabledItems); } BOOL LLFolderBridge::hasChildren() const { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; LLInventoryModel::EHasChildren has_children; @@ -2422,13 +2085,6 @@ BOOL LLFolderBridge::dragOrDrop(MASK mask, BOOL drop, LLViewerInventoryCategory* LLFolderBridge::getCategory() const { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return NULL; - } - // LLViewerInventoryCategory* cat = NULL; LLInventoryModel* model = mInventoryPanel->getModel(); if(model) @@ -2450,13 +2106,6 @@ void LLFolderBridge::createNewCategory(void* user_data) { LLFolderBridge* bridge = (LLFolderBridge*)user_data; if(!bridge) return; - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), bridge->mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLInventoryPanel* panel = bridge->mInventoryPanel; LLInventoryModel* model = panel->getModel(); if(!model) return; @@ -2561,13 +2210,6 @@ void LLFolderBridge::createWearable(LLUUID parent_id, EWearableType type) void LLFolderBridge::modifyOutfit(BOOL append) { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return; LLViewerInventoryCategory* cat = getCategory(); @@ -2619,13 +2261,6 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, BOOL drop) { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; @@ -3115,13 +2750,6 @@ LLCallingCardBridge::~LLCallingCardBridge() void LLCallingCardBridge::refreshFolderViewItem() { - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return; - } - // LLFolderViewItem* itemp = mInventoryPanel->getRootFolder()->getItemByID(mUUID); if (itemp) { @@ -3629,11 +3257,9 @@ LLUUID LLObjectBridge::sContextMenuItemID; BOOL LLObjectBridge::isItemRemovable() { - // - //LLVOAvatar* avatar = gAgent.getAvatarObject(); - //if(!avatar) return FALSE; - //if(avatar->isWearingAttachment(mUUID)) return FALSE; - // + LLVOAvatar* avatar = gAgent.getAvatarObject(); + if(!avatar) return FALSE; + if(avatar->isWearingAttachment(mUUID)) return FALSE; return LLInvFVBridge::isItemRemovable(); } @@ -3744,16 +3370,6 @@ std::string LLObjectBridge::getLabelSuffix() const } else { - // testzone attachpt - if(avatar) - { - std::map::iterator iter = avatar->mUnsupportedAttachmentPoints.begin(); - std::map::iterator end = avatar->mUnsupportedAttachmentPoints.end(); - for( ; iter != end; ++iter) - if((*iter).second == mUUID) - return LLItemBridge::getLabelSuffix() + llformat(" (worn on unsupported point %d)", (*iter).first); - } - // return LLItemBridge::getLabelSuffix(); } } @@ -3854,17 +3470,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Detach From Yourself")); } else - // testzone attachpt - if( avatarp->isWearingUnsupportedAttachment( mUUID ) ) - { - items.push_back(std::string("Detach From Yourself")); - } - else - // - // don't allow attaching objects while importing attachments - //if( !isInTrash() ) - if( !isInTrash() && !(LLXmlImport::sImportInProgress && LLXmlImport::sImportHasAttachments)) - // + if( !isInTrash() ) { items.push_back(std::string("Attach Separator")); items.push_back(std::string("Object Wear")); @@ -3899,37 +3505,13 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) NULL, &attach_label, (void*)attachment)); } - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - } - else - { - // - LLSimpleListener* callback = mInventoryPanel->getListenerByName("Inventory.AttachObject"); + LLSimpleListener* callback = mInventoryPanel->getListenerByName("Inventory.AttachObject"); - if (callback) - { - new_item->addListener(callback, "on_click", LLSD(attachment->getName())); - } - // derf + if (callback) + { + new_item->addListener(callback, "on_click", LLSD(attachment->getName())); } - // } - // - LLMenuItemCallGL *new_item = new LLMenuItemCallGL("Custom...", NULL, NULL); - attach_menu->append(new_item); - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - } - else - { - LLSimpleListener* callback = mInventoryPanel->getListenerByName("Inventory.AttachCustom"); - new_item->addListener(callback, "on_click", NULL); - } - // } } } @@ -3941,13 +3523,6 @@ BOOL LLObjectBridge::renameItem(const std::string& new_name) { if(!isItemRenameable()) return FALSE; LLPreview::rename(mUUID, getPrefix() + new_name); - // derf - if(std::find(LLInventoryPanel::sInstances.begin(), LLInventoryPanel::sInstances.end(), mInventoryPanel) == LLInventoryPanel::sInstances.end()) - { - llwarns << "scheduled for delayed delete" << llendl; - return FALSE; - } - // LLInventoryModel* model = mInventoryPanel->getModel(); if(!model) return FALSE; LLViewerInventoryItem* item = getItem(); @@ -4748,9 +4323,7 @@ BOOL LLWearableBridge::renameItem(const std::string& new_name) BOOL LLWearableBridge::isItemRemovable() { - // - //if(gAgent.isWearingItem(mUUID)) return FALSE; - // + if(gAgent.isWearingItem(mUUID)) return FALSE; return LLInvFVBridge::isItemRemovable(); } @@ -4920,7 +4493,6 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) (void*)this));*/ } } - hideContextEntries(menu, items, disabled_items); }