Index: src/libchcore/TSubTaskArray.cpp =================================================================== diff -u -rd88274a4bbfd4ef005d44c4d179b7596cb627486 -r297ce850732d4243414c851df145ca97bd696baa --- src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision d88274a4bbfd4ef005d44c4d179b7596cb627486) +++ src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 297ce850732d4243414c851df145ca97bd696baa) @@ -73,6 +73,7 @@ TSubTaskBase::ESubOperationResult TSubTasksArray::Execute(bool bRunOnlyEstimationSubTasks) { TSubTaskBase::ESubOperationResult eResult = TSubTaskBase::eSubResult_Continue; + TTaskBasicProgressInfo& rBasicProgressInfo = m_rSubTaskContext.GetTaskBasicProgressInfo(); size_t stSubOperationIndex = m_rSubTaskContext.GetTaskBasicProgressInfo().GetSubOperationIndex(); for(; stSubOperationIndex < m_vSubTasks.size() && eResult == TSubTaskBase::eSubResult_Continue; ++stSubOperationIndex) @@ -92,6 +93,11 @@ } eResult = spCurrentSubTask->Exec(); + if(eResult == TSubTaskBase::eSubResult_Continue) + { + // reset progress for each subtask + rBasicProgressInfo.SetCurrentIndex(0); + } } return eResult; Index: src/libchcore/TSubTaskCopyMove.cpp =================================================================== diff -u -rd88274a4bbfd4ef005d44c4d179b7596cb627486 -r297ce850732d4243414c851df145ca97bd696baa --- src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision d88274a4bbfd4ef005d44c4d179b7596cb627486) +++ src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 297ce850732d4243414c851df145ca97bd696baa) @@ -131,6 +131,8 @@ for(size_t stIndex = rBasicProgressInfo.GetCurrentIndex(); stIndex < stSize; stIndex++) { + rBasicProgressInfo.SetCurrentIndex(stIndex); + // should we kill ? if(rThreadController.KillRequested()) { @@ -139,7 +141,7 @@ return TSubTaskBase::eSubResult_KillRequest; } - // update m_stNextIndex, getting current CFileInfo + // next file to be copied TFileInfoPtr spFileInfo = rFilesCache.GetAt(rBasicProgressInfo.GetCurrentIndex()); // set dest path with filename @@ -215,8 +217,6 @@ // attributes if(GetTaskPropValue(rTaskDefinition.GetConfiguration())) TLocalFilesystem::SetAttributes(ccp.pathDstFile, spFileInfo->GetAttributes()); // as above - - rBasicProgressInfo.SetCurrentIndex(stIndex + 1); } // delete buffer - it's not needed Index: src/libchcore/TSubTaskDelete.cpp =================================================================== diff -u -r25b3c85ea493809ee084271d5101a015d349da95 -r297ce850732d4243414c851df145ca97bd696baa --- src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision 25b3c85ea493809ee084271d5101a015d349da95) +++ src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision 297ce850732d4243414c851df145ca97bd696baa) @@ -27,7 +27,6 @@ #include "TWorkerThreadController.h" #include "TTaskConfiguration.h" #include "TTaskDefinition.h" -//#include "FeedbackHandler.h" #include "TLocalFilesystem.h" #include "..\libicpf\log.h" #include "FeedbackHandlerBase.h" Index: src/libchcore/TSubTaskFastMove.cpp =================================================================== diff -u -rd88274a4bbfd4ef005d44c4d179b7596cb627486 -r297ce850732d4243414c851df145ca97bd696baa --- src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision d88274a4bbfd4ef005d44c4d179b7596cb627486) +++ src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision 297ce850732d4243414c851df145ca97bd696baa) @@ -151,38 +151,48 @@ bool bResult = true; do { - bResult = TLocalFilesystem::FastMove(rTaskDefinition.GetSourcePathAt(stIndex), CalculateDestinationPath(spFileInfo, rTaskDefinition.GetDestinationPath(), 0)); + TSmartPath pathDestinationPath = CalculateDestinationPath(spFileInfo, rTaskDefinition.GetDestinationPath(), 0); + bResult = TLocalFilesystem::FastMove(rTaskDefinition.GetSourcePathAt(stIndex), pathDestinationPath); if(!bResult) { DWORD dwLastError = GetLastError(); - //log - strFormat = _T("Error %errno while calling fast move %srcpath -> %dstpath (TSubTaskFastMove)"); - strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); - strFormat.Replace(_T("%srcpath"), spFileInfo->GetFullFilePath().ToString()); - strFormat.Replace(_T("%dstpath"), rTaskDefinition.GetDestinationPath().ToString()); - rLog.loge(strFormat); - - FEEDBACK_FILEERROR ferr = { rTaskDefinition.GetSourcePathAt(stIndex).ToString(), rTaskDefinition.GetDestinationPath().ToString(), eFastMoveError, dwLastError }; - IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)piFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); - switch(frResult) + // check if this is one of the errors, that will just cause fast move to skip + if(dwLastError == ERROR_ACCESS_DENIED || dwLastError == ERROR_ALREADY_EXISTS) { - case IFeedbackHandler::eResult_Cancel: - return TSubTaskBase::eSubResult_CancelRequest; + bRetry = false; + bResult = true; + } + else + { + //log + strFormat = _T("Error %errno while calling fast move %srcpath -> %dstpath (TSubTaskFastMove)"); + strFormat.Replace(_T("%errno"), boost::lexical_cast(dwLastError).c_str()); + strFormat.Replace(_T("%srcpath"), spFileInfo->GetFullFilePath().ToString()); + strFormat.Replace(_T("%dstpath"), rTaskDefinition.GetDestinationPath().ToString()); + rLog.loge(strFormat); - case IFeedbackHandler::eResult_Retry: - continue; + FEEDBACK_FILEERROR ferr = { rTaskDefinition.GetSourcePathAt(stIndex).ToString(), pathDestinationPath.ToString(), eFastMoveError, dwLastError }; + IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)piFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); + switch(frResult) + { + case IFeedbackHandler::eResult_Cancel: + return TSubTaskBase::eSubResult_CancelRequest; - case IFeedbackHandler::eResult_Pause: - return TSubTaskBase::eSubResult_PauseRequest; + case IFeedbackHandler::eResult_Retry: + continue; - case IFeedbackHandler::eResult_Skip: - //bSkipInputPath = true; // not needed, since we will break the loop anyway and there is no other processing for this path either - bRetry = false; - break; // just do nothing - default: - BOOST_ASSERT(FALSE); // unknown result - THROW_CORE_EXCEPTION(eErr_UnhandledCase); + case IFeedbackHandler::eResult_Pause: + return TSubTaskBase::eSubResult_PauseRequest; + + case IFeedbackHandler::eResult_Skip: + //bSkipInputPath = true; // not needed, since we will break the loop anyway and there is no other processing for this path either + bRetry = false; + break; // just do nothing + default: + BOOST_ASSERT(FALSE); // unknown result + THROW_CORE_EXCEPTION(eErr_UnhandledCase); + } } } else