diff options
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 63 |
1 files changed, 35 insertions, 28 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index adfd0aadba..25025038d2 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2981,12 +2981,16 @@ bool LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, if (dest_res == MY_OUTFITS_SUBFOLDER && create_outfit) { // turn it into outfit - dropToMyOutfitsSubfolder(inv_cat, mUUID, LLFolderType::FT_OUTFIT, cb); + dropToMyOutfitsSubfolder(inv_cat, mUUID, cb); } else { - // or link it? - dropToMyOutfitsSubfolder(inv_cat, mUUID, LLFolderType::FT_NONE, cb); + LLInvFVBridge::changeCategoryParent( + model, + (LLViewerInventoryCategory*)inv_cat, + mUUID, + move_is_into_trash); + if (cb) cb->fire(inv_cat->getUUID()); } break; case MY_OUTFITS_SUBFOLDER: @@ -4114,10 +4118,14 @@ void LLFolderBridge::perform_pasteFromClipboard() } if (move_is_into_outfit) { - if (!move_is_into_my_outfits && item && can_move_to_outfit(item, move_is_into_current_outfit)) + bool handled = false; + if (mUUID != my_outifts_id + && dest_folder->getPreferredType() == LLFolderType::FT_OUTFIT + && item + && can_move_to_outfit(item, move_is_into_current_outfit)) { - // todo: this is going to create dupplicate folders? dropToOutfit(item, move_is_into_current_outfit, cb); + handled = true; } else if (move_is_into_my_outfits && LLAssetType::AT_CATEGORY == obj->getType()) { @@ -4128,39 +4136,39 @@ void LLFolderBridge::perform_pasteFromClipboard() if (mUUID == my_outifts_id) { dropToMyOutfits(cat, cb); + handled = true; } - else if (move_is_into_my_outfits) + else { - EMyOutfitsSubfolderType res = myoutfit_object_subfolder_type(model, mUUID, my_outifts_id); - if (res == MY_OUTFITS_SUBFOLDER) + EMyOutfitsSubfolderType dest_res = myoutfit_object_subfolder_type(model, mUUID, my_outifts_id); + if (dest_res == MY_OUTFITS_SUBFOLDER) { // turn it into outfit - dropToMyOutfitsSubfolder(cat, mUUID, LLFolderType::FT_OUTFIT, cb); - } - else - { - dropToMyOutfitsSubfolder(cat, mUUID, LLFolderType::FT_NONE, cb); + dropToMyOutfitsSubfolder(cat, mUUID, cb); + handled = true; } } } - else if (cat && can_move_to_my_outfits_as_subfolder(model, cat)) + if (!handled && cat && can_move_to_my_outfits_as_subfolder(model, cat)) { - if (LLClipboard::instance().isCutMode()) + EMyOutfitsSubfolderType dest_res = myoutfit_object_subfolder_type(model, mUUID, my_outifts_id); + if (dest_res == MY_OUTFITS_SUBFOLDER || mUUID == my_outifts_id) { - changeCategoryParent(model, cat, parent_id, false); + if (LLClipboard::instance().isCutMode()) + { + changeCategoryParent(model, cat, parent_id, false); + } + else + { + copy_inventory_category(model, cat, parent_id); + } if (cb) cb->fire(item_id); - } - else - { - copy_inventory_category(model, cat, parent_id); + handled = true; } } - else - { - LLNotificationsUtil::add("MyOutfitsPasteFailed"); - } } - else + + if (!handled) { LLNotificationsUtil::add("MyOutfitsPasteFailed"); } @@ -5502,12 +5510,11 @@ void LLFolderBridge::dropToMyOutfits(LLInventoryCategory* inv_cat, LLPointer<LLI inv_cat->getThumbnailUUID()); } -void LLFolderBridge::dropToMyOutfitsSubfolder(LLInventoryCategory* inv_cat, const LLUUID& dest_id, LLFolderType::EType preferred_type, LLPointer<LLInventoryCallback> cb) +void LLFolderBridge::dropToMyOutfitsSubfolder(LLInventoryCategory* inv_cat, const LLUUID& dest_id, LLPointer<LLInventoryCallback> cb) { - const LLUUID outfits_id = getInventoryModel()->findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); inventory_func_type func = boost::bind(outfitFolderCreatedCallback, inv_cat->getUUID(), _1, cb, mInventoryPanel); getInventoryModel()->createNewCategory(dest_id, - preferred_type, + LLFolderType::FT_OUTFIT, inv_cat->getName(), func, inv_cat->getThumbnailUUID()); |