SL-20651 DragnDrop from library in gallery mode doesn't work

master
Andrey Kleshchev 2023-11-28 14:08:23 +02:00 committed by akleshchev
parent 15ea200cfb
commit d2ade35b09
2 changed files with 14 additions and 12 deletions

View File

@ -2386,7 +2386,7 @@ BOOL LLInventoryGallery::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
return handled;
}
void LLInventoryGallery::startDrag()
void LLInventoryGallery::startDrag()
{
std::vector<EDragAndDropType> types;
uuid_vec_t ids;
@ -2407,22 +2407,25 @@ void LLInventoryGallery::startDrag()
}
const LLViewerInventoryCategory* cat = gInventory.getCategory(selected_id);
if (cat && gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID())
&& !LLFolderType::lookupIsProtectedType((cat)->getPreferredType()))
if (cat)
{
if (cat->getOwnerID() == ALEXANDRIA_LINDEN_ID)
if (gInventory.isObjectDescendentOf(selected_id, gInventory.getLibraryRootFolderID()))
{
src = LLToolDragAndDrop::SOURCE_LIBRARY;
EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType());
types.push_back(type);
ids.push_back(selected_id);
}
else if (gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID())
&& !LLFolderType::lookupIsProtectedType((cat)->getPreferredType()))
{
EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType());
types.push_back(type);
ids.push_back(selected_id);
}
EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType());
types.push_back(type);
ids.push_back(selected_id);
}
}
// We must have set this for some reason, but it's causing compile errors
(void)src;
LLToolDragAndDrop::getInstance()->beginMultiDrag(types, ids, LLToolDragAndDrop::SOURCE_AGENT);
LLToolDragAndDrop::getInstance()->beginMultiDrag(types, ids, src);
}
bool LLInventoryGallery::areViewsInitialized()

View File

@ -358,7 +358,6 @@ void LLInventoryFetchItemsObserver::startFetch()
{
// Start fetching whole folder since we need all items
LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(folder.first, true);
}
else
{