diff options
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 95 |
1 files changed, 48 insertions, 47 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index b9775cf0e9..b9a25d5dc7 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -78,6 +78,7 @@ #include "llscrollcontainer.h" #include "llimview.h" #include "lltooldraganddrop.h" +#include "llviewerfoldertype.h" #include "llviewertexturelist.h" #include "llviewerinventory.h" #include "llviewerobjectlist.h" @@ -85,6 +86,7 @@ #include "llvoavatar.h" #include "llwearable.h" #include "llwearablelist.h" +#include "llviewerassettype.h" #include "llviewermessage.h" #include "llviewerregion.h" #include "llvoavatarself.h" @@ -202,9 +204,9 @@ PermissionMask LLInvFVBridge::getPermissionMask() const } // virtual -LLAssetType::EType LLInvFVBridge::getPreferredType() const +LLFolderType::EType LLInvFVBridge::getPreferredType() const { - return LLAssetType::AT_NONE; + return LLFolderType::FT_NONE; } @@ -339,7 +341,7 @@ void LLInvFVBridge::removeBatchNoCheck(LLDynamicArray<LLFolderViewEventListener* LLInventoryModel* model = getInventoryModel(); if(!model) return; LLMessageSystem* msg = gMessageSystem; - LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); LLViewerInventoryItem* item = NULL; LLViewerInventoryCategory* cat = NULL; std::vector<LLUUID> move_ids; @@ -504,7 +506,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const } } const LLViewerInventoryCategory *cat = model->getCategory(objects.get(i)); - if (cat && !LLAssetType::lookupCanLink(cat->getPreferredType())) + if (cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { return FALSE; } @@ -645,7 +647,7 @@ BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const if(obj) { - *type = LLAssetType::lookupDragAndDropType(obj->getActualType()); + *type = LLViewerAssetType::lookupDragAndDropType(obj->getActualType()); if(*type == DAD_NONE) { return FALSE; @@ -686,7 +688,7 @@ BOOL LLInvFVBridge::isInTrash() const { LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; - const LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); return model->isObjectDescendentOf(mUUID, trash_id); } @@ -699,7 +701,7 @@ BOOL LLInvFVBridge::isLinkedObjectInTrash() const { LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; - const LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); return model->isObjectDescendentOf(obj->getLinkedUUID(), trash_id); } return FALSE; @@ -717,7 +719,7 @@ BOOL LLInvFVBridge::isCOFFolder() const { const LLInventoryModel* model = getInventoryModel(); if(!model) return TRUE; - const LLUUID cof_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_CURRENT_OUTFIT); + const LLUUID cof_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); if (mUUID == cof_id || model->isObjectDescendentOf(mUUID, cof_id)) { return TRUE; @@ -1044,7 +1046,7 @@ void LLItemBridge::restoreItem() if(item) { LLInventoryModel* model = getInventoryModel(); - const LLUUID new_parent = model->findCategoryUUIDForType(item->getType()); + const LLUUID new_parent = model->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType())); // do not restamp on restore. LLInvFVBridge::changeItemParent(model, item, new_parent, FALSE); } @@ -1077,7 +1079,7 @@ void LLItemBridge::restoreToWorld() } // Check if it's in the trash. (again similar to the normal rez logic) - const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_TRASH); + const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH); if(gInventory.isObjectDescendentOf(itemp->getUUID(), trash_id)) { remove_from_inventory = TRUE; @@ -1272,7 +1274,7 @@ BOOL LLItemBridge::removeItem() LLPreview::hide(mUUID, TRUE); LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; - LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); LLViewerInventoryItem* item = getItem(); // if item is not already in trash @@ -1365,7 +1367,7 @@ BOOL LLFolderBridge::isItemMovable() const LLInventoryObject* obj = getInventoryObject(); if(obj) { - return (!LLAssetType::lookupIsProtectedCategoryType(((LLInventoryCategory*)obj)->getPreferredType())); + return (!LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)obj)->getPreferredType())); } return FALSE; } @@ -1401,7 +1403,7 @@ BOOL LLFolderBridge::isItemRemovable() return FALSE; } - if(LLAssetType::lookupIsProtectedCategoryType(category->getPreferredType())) + if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) { return FALSE; } @@ -1414,7 +1416,7 @@ BOOL LLFolderBridge::isItemRemovable() for( i = 0; i < descendent_categories.count(); i++ ) { LLInventoryCategory* category = descendent_categories[i]; - if(LLAssetType::lookupIsProtectedCategoryType(category->getPreferredType())) + if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) { return FALSE; } @@ -1591,20 +1593,20 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const LLUUID& cat_id = inv_cat->getUUID(); // Is the destination the trash? - const LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); - BOOL is_movable = (!LLAssetType::lookupIsProtectedCategoryType(inv_cat->getPreferredType())); - LLUUID current_outfit_id = model->findCategoryUUIDForType(LLAssetType::AT_CURRENT_OUTFIT); + BOOL is_movable = (!LLFolderType::lookupIsProtectedType(inv_cat->getPreferredType())); + const LLUUID current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); - BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLAssetType::AT_OUTFIT); + BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); if (move_is_into_current_outfit || move_is_into_outfit) { // BAP - restrictions? is_movable = true; } - if (mUUID == gInventory.findCategoryUUIDForType(LLAssetType::AT_FAVORITE)) + if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE)) { is_movable = FALSE; // It's generally movable but not into Favorites folder. EXT-1604 } @@ -1616,7 +1618,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, for( i = 0; i < descendent_categories.count(); i++ ) { LLInventoryCategory* category = descendent_categories[i]; - if(LLAssetType::lookupIsProtectedCategoryType(category->getPreferredType())) + if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) { // ...can't move "special folders" like Textures is_movable = FALSE; @@ -1849,8 +1851,8 @@ bool LLFindCOFValidItems::operator()(LLInventoryCategory* cat, LLViewerInventoryCategory *linked_category = ((LLViewerInventoryItem*)item)->getLinkedCategory(); // BAP - safe? // BAP remove AT_NONE support after ensembles are fully working? return (linked_category && - ((linked_category->getPreferredType() == LLAssetType::AT_NONE) || - (LLAssetType::lookupIsEnsembleCategoryType(linked_category->getPreferredType())))); + ((linked_category->getPreferredType() == LLFolderType::FT_NONE) || + (LLFolderType::lookupIsEnsembleType(linked_category->getPreferredType())))); } } @@ -2152,7 +2154,7 @@ void LLFolderBridge::determineFolderType() BOOL LLFolderBridge::isItemRenameable() const { LLViewerInventoryCategory* cat = (LLViewerInventoryCategory*)getCategory(); - if(cat && !LLAssetType::lookupIsProtectedCategoryType(cat->getPreferredType()) + if(cat && !LLFolderType::lookupIsProtectedType(cat->getPreferredType()) && (cat->getOwnerID() == gAgent.getID())) { return TRUE; @@ -2167,15 +2169,15 @@ void LLFolderBridge::restoreItem() if(cat) { LLInventoryModel* model = getInventoryModel(); - LLUUID new_parent = model->findCategoryUUIDForType(cat->getType()); + const LLUUID new_parent = model->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(cat->getType())); // do not restamp children on restore LLInvFVBridge::changeCategoryParent(model, cat, new_parent, FALSE); } } -LLAssetType::EType LLFolderBridge::getPreferredType() const +LLFolderType::EType LLFolderBridge::getPreferredType() const { - LLAssetType::EType preferred_type = LLAssetType::AT_NONE; + LLFolderType::EType preferred_type = LLFolderType::FT_NONE; LLViewerInventoryCategory* cat = getCategory(); if(cat) { @@ -2188,7 +2190,7 @@ LLAssetType::EType LLFolderBridge::getPreferredType() const // Icons for folders are based on the preferred type LLUIImagePtr LLFolderBridge::getIcon() const { - LLAssetType::EType preferred_type = LLAssetType::AT_NONE; + LLFolderType::EType preferred_type = LLFolderType::FT_NONE; LLViewerInventoryCategory* cat = getCategory(); if(cat) { @@ -2197,7 +2199,7 @@ LLUIImagePtr LLFolderBridge::getIcon() const return getIcon(preferred_type); } -LLUIImagePtr LLFolderBridge::getIcon(LLAssetType::EType preferred_type) +LLUIImagePtr LLFolderBridge::getIcon(LLFolderType::EType preferred_type) { // we only have one folder image now return LLUI::getUIImage("Inv_FolderClosed"); @@ -2236,7 +2238,7 @@ BOOL LLFolderBridge::removeItem() LLInventoryModel* model = getInventoryModel(); if(!model) return FALSE; - LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); // Look for any gestures and deactivate them LLInventoryModel::cat_array_t descendent_categories; @@ -2354,11 +2356,11 @@ void LLFolderBridge::folderOptionsMenu() if(!model) return; const LLInventoryCategory* category = model->getCategory(mUUID); - LLAssetType::EType type = category->getPreferredType(); - const bool is_default_folder = category && LLAssetType::lookupIsProtectedCategoryType(type); + LLFolderType::EType type = category->getPreferredType(); + const bool is_default_folder = category && LLFolderType::lookupIsProtectedType(type); // BAP change once we're no longer treating regular categories as ensembles. - const bool is_ensemble = category && (type == LLAssetType::AT_NONE || - LLAssetType::lookupIsEnsembleCategoryType(type)); + const bool is_ensemble = category && (type == LLFolderType::FT_NONE || + LLFolderType::lookupIsEnsembleType(type)); // calling card related functionality for folders. @@ -2424,8 +2426,8 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // std::vector<std::string> disabled_items; LLInventoryModel* model = getInventoryModel(); if(!model) return; - LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); - LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); + const LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND); mItems.clear(); //adding code to clear out member Items (which means Items should not have other data here at this point) mDisabledItems.clear(); //adding code to clear out disabled members from previous @@ -2455,7 +2457,6 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else if(isAgentInventory()) // do not allow creating in library { LLViewerInventoryCategory *cat = getCategory(); - // BAP removed protected check to re-enable standard ops in untyped folders. // Not sure what the right thing is to do here. if (!isCOFFolder() && cat /*&& @@ -2472,7 +2473,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mItems.push_back(std::string("Change Type")); LLViewerInventoryCategory *cat = getCategory(); - if (cat && LLAssetType::lookupIsProtectedCategoryType(cat->getPreferredType())) + if (cat && LLFolderType::lookupIsProtectedType(cat->getPreferredType())) { mDisabledItems.push_back(std::string("Change Type")); } @@ -2482,7 +2483,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { // Want some but not all of the items from getClipboardEntries for outfits. - if (cat && cat->getPreferredType()==LLAssetType::AT_OUTFIT) + if (cat && cat->getPreferredType()==LLFolderType::FT_OUTFIT) { mItems.push_back(std::string("Rename")); mItems.push_back(std::string("Delete")); @@ -2618,7 +2619,7 @@ void LLFolderBridge::createNewCategory(void* user_data) if(!model) return; LLUUID id; id = model->createNewCategory(bridge->getUUID(), - LLAssetType::AT_NONE, + LLFolderType::FT_NONE, LLStringUtil::null); model->notifyObservers(); @@ -2703,7 +2704,7 @@ void LLFolderBridge::createWearable(LLFolderBridge* bridge, EWearableType type) // Separate function so can be called by global menu as well as right-click // menu. // static -void LLFolderBridge::createWearable(LLUUID parent_id, EWearableType type) +void LLFolderBridge::createWearable(const LLUUID &parent_id, EWearableType type) { LLWearable* wearable = LLWearableList::instance().createNewWearable(type); LLAssetType::EType asset_type = wearable->getAssetType(); @@ -2846,17 +2847,17 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, break; case LLAssetType::AT_CATEGORY: - is_movable = !LLAssetType::lookupIsProtectedCategoryType(((LLInventoryCategory*)inv_item)->getPreferredType()); + is_movable = !LLFolderType::lookupIsProtectedType(((LLInventoryCategory*)inv_item)->getPreferredType()); break; default: break; } - LLUUID trash_id = model->findCategoryUUIDForType(LLAssetType::AT_TRASH); + const LLUUID trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH); BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); - LLUUID current_outfit_id = model->findCategoryUUIDForType(LLAssetType::AT_CURRENT_OUTFIT); + const LLUUID current_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); - BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLAssetType::AT_OUTFIT); + BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); if(is_movable && move_is_into_trash) { @@ -2886,7 +2887,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, .isObjDirectDescendentOfCategory (inv_item, getCategory()); } - LLUUID favorites_id = model->findCategoryUUIDForType(LLAssetType::AT_FAVORITE); + const LLUUID& favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE); // we can move item inside a folder only if this folder is Favorites. See EXT-719 accept = is_movable && ((mUUID != inv_item->getParentUUID()) || (mUUID == favorites_id)); @@ -4934,7 +4935,7 @@ void LLLSLTextBridgeAction::doIt() BOOL LLWearableBridgeAction::isInTrash() const { if(!mModel) return FALSE; - LLUUID trash_id = mModel->findCategoryUUIDForType(LLAssetType::AT_TRASH); + const LLUUID trash_id = mModel->findCategoryUUIDForType(LLFolderType::FT_TRASH); return mModel->isObjectDescendentOf(mUUID, trash_id); } @@ -5073,7 +5074,7 @@ std::string LLLinkFolderBridge::sPrefix("Link: "); LLUIImagePtr LLLinkFolderBridge::getIcon() const { - LLAssetType::EType preferred_type = LLAssetType::AT_NONE; + LLFolderType::EType preferred_type = LLFolderType::FT_NONE; if (LLViewerInventoryItem *item = getItem()) { if (const LLViewerInventoryCategory* cat = item->getLinkedCategory()) |