rendered paste bodyvoid copy_dropentries()
{
IPTR destination_path;
struct IconList_Drop *drop = FindTask(NULL)->tc_UserData;
if (drop)
{
/* get path of DESTINATION iconlist*/
destination_path = drop->destination_string;
if ( !destination_path ) return;
/* get SOURCE entries */
struct MUIDisplayObjects dobjects;
struct Hook displayCopyHook;
struct Hook displayDelHook;
displayCopyHook.h_Entry = (HOOKFUNC) Wanderer__HookFunc_DisplayCopyFunc;
displayDelHook.h_Entry = (HOOKFUNC) Wanderer__HookFunc_AskDeleteFunc;
if (CreateCopyDisplay(ACTION_COPY, &dobjects))
{
struct IconList_Entry *ent = (void*)MUIV_IconList_NextSelected_Start;
/* process all selected entries */
do
{
DoMethod(drop->source_iconlistobj, MUIM_IconList_NextSelected, (IPTR) &ent);
/* if not end of selection, process */
if ( (int)ent != MUIV_IconList_NextSelected_End )
{
D(bug("[WANDERER] drop entry: %s dropped in %s\n", ent->filename, destination_path));
/* copy via filesystems.c */
D(bug("[WANDERER] CopyContent \"%s\" to \"%s\"\n", ent->filename, destination_path ));
CopyContent(NULL, ent->filename, destination_path, TRUE, ACTION_COPY, &displayCopyHook, &displayDelHook, (APTR) &dobjects);
}
}
while ( (int)ent != MUIV_IconList_NextSelected_End );
// DisposeCopyDisplay(&dobjects);
}
/* update list contents */
DoMethod(drop->destination_iconlistobj,MUIM_IconList_Update);
}
return;
}
. .. .
else if (msg->type == ICONWINDOW_ACTION_ICONDROP)
{
struct Process *child;
child = CreateNewProcTags(
NP_Entry, copy_dropentries,
NP_UserData, (IPTR)msg->drop ,
NP_Name, (ULONG)"wanderer copy",
NP_StackSize, 40000,
TAG_DONE);
}