Index: src/libchcore/TSubTaskScanDirectory.cpp =================================================================== diff -u -N -r7365307e6b78c9bc9db376635405e8c69d786381 -rd88274a4bbfd4ef005d44c4d179b7596cb627486 --- src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 7365307e6b78c9bc9db376635405e8c69d786381) +++ src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision d88274a4bbfd4ef005d44c4d179b7596cb627486) @@ -54,9 +54,9 @@ TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); IFeedbackHandler* piFeedbackHandler = GetContext().GetFeedbackHandler(); - const TBasePathDataContainer& rarrSourcePathsInfo = GetContext().GetBasePathDataContainer(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); TTaskLocalStats& rTaskLocalStats = GetContext().GetTaskLocalStats(); + TBasePathDataContainer& rBasePathDataContainer = GetContext().GetBasePathDataContainer(); rLog.logi(_T("Searching for files...")); @@ -72,12 +72,8 @@ TFileFiltersArray afFilters; GetTaskPropValue(rTaskDefinition.GetConfiguration(), afFilters); - // enter some data to rFilesCache - wchar_t wchDestinationDriveLetter = rTaskDefinition.GetDestinationPath().GetDriveLetter(); - bool bIgnoreDirs = GetTaskPropValue(rTaskDefinition.GetConfiguration()); bool bForceDirectories = GetTaskPropValue(rTaskDefinition.GetConfiguration()); - bool bMove = rTaskDefinition.GetOperationType() == eOperation_Move; // add everything TString strFormat; @@ -87,12 +83,18 @@ size_t stSize = rTaskDefinition.GetSourcePathCount(); for(size_t stIndex = 0; stIndex < stSize ; stIndex++) { - TFileInfoPtr spFileInfo; - bSkipInputPath = false; + TFileInfoPtr spFileInfo(boost::make_shared()); - spFileInfo.reset(new TFileInfo()); + // retrieve base path data + TBasePathDataPtr spBasePathData = rBasePathDataContainer.GetAt(stIndex); + if(!spBasePathData) + THROW_CORE_EXCEPTION(eErr_InvalidPointer); + // check if we want to process this path at all (might be already fast moved) + if(spBasePathData->GetSkipFurtherProcessing()) + continue; + // try to get some info about the input path; let user know if the path does not exist. do { @@ -139,8 +141,6 @@ strFormat.Replace(_T("%path"), rTaskDefinition.GetSourcePathAt(stIndex).ToString()); rLog.logi(strFormat); - wchar_t wchSourceDriveLetter = spFileInfo->GetFullFilePath().GetDriveLetter(); - // add if needed if(spFileInfo->IsDirectory()) { @@ -157,20 +157,13 @@ } // don't add folder contents when moving inside one disk boundary - if(bIgnoreDirs || !bMove || wchDestinationDriveLetter == L'\0' || wchDestinationDriveLetter != wchSourceDriveLetter || - TLocalFilesystem::PathExist(CalculateDestinationPath(spFileInfo, rTaskDefinition.GetDestinationPath(), ((int)bForceDirectories) << 1)) ) - { - // log - strFormat = _T("Recursing folder %path"); - strFormat.Replace(_t("%path"), spFileInfo->GetFullFilePath().ToString()); - rLog.logi(strFormat); + // log + strFormat = _T("Recursing folder %path"); + strFormat.Replace(_t("%path"), spFileInfo->GetFullFilePath().ToString()); + rLog.logi(strFormat); - // no movefile possibility - use CustomCopyFileFB - rarrSourcePathsInfo.GetAt(stIndex)->SetMove(false); + ScanDirectory(spFileInfo->GetFullFilePath(), stIndex, true, !bIgnoreDirs || bForceDirectories, afFilters); - ScanDirectory(spFileInfo->GetFullFilePath(), stIndex, true, !bIgnoreDirs || bForceDirectories, afFilters); - } - // check for kill need if(rThreadController.KillRequested()) { @@ -182,16 +175,6 @@ } else { - if(bMove && wchDestinationDriveLetter != L'\0' && wchDestinationDriveLetter == wchSourceDriveLetter && - !TLocalFilesystem::PathExist(CalculateDestinationPath(spFileInfo, rTaskDefinition.GetDestinationPath(), ((int)bForceDirectories) << 1)) ) - { - // if moving within one partition boundary set the file size to 0 so the overall size will - // be ok - spFileInfo->SetLength64(0); - } - else - rarrSourcePathsInfo.GetAt(stIndex)->SetMove(false); // no MoveFile - // add file info if passes filters if(afFilters.Match(spFileInfo)) rFilesCache.AddFileInfo(spFileInfo);