MCPcopy Create free account
hub / github.com/bumptop/BumpTop / onDrop

Method onDrop

trunk/win/Source/BT_FileSystemActor.cpp:678–894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

676 return copyFile;
677}
678vector<BumpObject *> FileSystemActor::onDrop(vector<BumpObject *> &objList)
679{
680 QString fPath;
681 FileSystemActor *fsData;
682 Pile *pile;
683 FileSystemPile *fsPile;
684 Vec3 topPt;
685 bool moveItem = true;
686 bool operationSucceeded = false;
687 vector<FileSystemActor *> failedObj, fsObjList;
688 vector<BumpObject *> failedBumpObjs;
689 vector<FileSystemActor *> hardPileOwners;
690
691 if (!isSourceValid())
692 {
693 return objList;
694 }
695 else
696 {
697 // Convert Piles to Free Items
698 for (int i = 0; i < objList.size(); i++)
699 {
700 // Do Pile to free Item conversions
701 if (objList[i]->getObjectType() == ObjectType(BumpPile, HardPile, Stack))
702 {
703 // If its a Hard Pile, get its owner and use it instead of pile members
704 fsPile = (FileSystemPile *) objList[i];
705
706 objList.erase(objList.begin() + i);
707 objList.push_back(fsPile->getOwner());
708 hardPileOwners.push_back(fsPile->getOwner());
709
710 fsPile->folderize(false);
711
712 i--;
713
714 }else if (objList[i]->getObjectType() == ObjectType(BumpPile, SoftPile, Stack))
715 {
716 pile = (Pile *) objList[i];
717
718 objList.erase(objList.begin() + i);
719 i--;
720
721 // If its a Soft Pile, use its members instead of the pile
722 for (uint j = 0; j < pile->getNumItems(); j++)
723 {
724 objList.push_back((*pile)[j]);
725 }
726 }
727 }
728
729 if (isFileSystemType(Executable))
730 {
731 for (uint i = 0; i < objList.size(); i++)
732 {
733 // Create a parameter list separated by spaces
734 fsData = (FileSystemActor *) objList[i];
735

Callers

nothing calls this directly

Calls 15

ObjectTypeClass · 0.85
FadeAndDeleteActorFunction · 0.85
getTextFunction · 0.85
getOwnerMethod · 0.80
folderizeMethod · 0.80
containsObjectMethod · 0.80
getFullPathMethod · 0.80
launchFileAsyncMethod · 0.80
markDragCancelledMethod · 0.80
clearStateMethod · 0.80

Tested by

no test coverage detected