Index: src/libchcore/TBasePathData.h =================================================================== diff -u -N -r1e687d59f0e622a610cbf97cf79febd12641d159 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TBasePathData.h (.../TBasePathData.h) (revision 1e687d59f0e622a610cbf97cf79febd12641d159) +++ src/libchcore/TBasePathData.h (.../TBasePathData.h) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -73,6 +73,8 @@ void RemoveAt(size_t nIndex, size_t nCount = 1); void Clear(); + const TPathContainer& GetBasePaths() const { return m_tBasePaths; } + // serialization void Serialize(TReadBinarySerializer& rSerializer, bool bData); void Serialize(TWriteBinarySerializer& rSerializer, bool bData); Index: src/libchcore/TSubTaskArray.cpp =================================================================== diff -u -N -ra5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision a5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8) +++ src/libchcore/TSubTaskArray.cpp (.../TSubTaskArray.cpp) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -106,12 +106,14 @@ // TSubTasksArray TSubTasksArray::TSubTasksArray() : - m_pSubTaskContext(NULL) + m_pSubTaskContext(NULL), + m_eOperationType(eOperation_None) { } TSubTasksArray::TSubTasksArray(const TOperationPlan& rOperationPlan, TSubTaskContext& rSubTaskContext) : - m_pSubTaskContext(NULL) + m_pSubTaskContext(NULL), + m_eOperationType(eOperation_None) { Init(rOperationPlan, rSubTaskContext); } @@ -126,7 +128,9 @@ m_tProgressInfo.ResetProgress(); m_pSubTaskContext = &rSubTaskContext; - switch(rOperationPlan.GetOperationType()) + m_eOperationType = rOperationPlan.GetOperationType(); + + switch(m_eOperationType) { case eOperation_Copy: { @@ -245,4 +249,9 @@ } } +EOperationType TSubTasksArray::GetOperationType() const +{ + return m_eOperationType; +} + END_CHCORE_NAMESPACE Index: src/libchcore/TSubTaskArray.h =================================================================== diff -u -N -ra5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TSubTaskArray.h (.../TSubTaskArray.h) (revision a5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8) +++ src/libchcore/TSubTaskArray.h (.../TSubTaskArray.h) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -80,6 +80,7 @@ ~TSubTasksArray(); void Init(const TOperationPlan& rOperationPlan, TSubTaskContext& rSubTaskContext); + EOperationType GetOperationType() const; // Stats handling void GetStatsSnapshot(TSubTaskArrayStatsSnapshot& rSnapshot) const; @@ -99,6 +100,7 @@ private: TSubTaskContext* m_pSubTaskContext; + EOperationType m_eOperationType; #pragma warning(push) #pragma warning(disable: 4251) Index: src/libchcore/TSubTaskBase.cpp =================================================================== diff -u -N -r548382442cbf7bed7f744b279ce3f66b54992724 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision 548382442cbf7bed7f744b279ce3f66b54992724) +++ src/libchcore/TSubTaskBase.cpp (.../TSubTaskBase.cpp) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -25,7 +25,6 @@ #include "TBasePathData.h" #include "TLocalFilesystem.h" #include "TSubTaskContext.h" -#include "TTaskDefinition.h" #include "TTaskConfiguration.h" #include #include "TFileInfo.h" @@ -93,21 +92,21 @@ // finds another name for a copy of src file(folder) in dest location TSmartPath TSubTaskBase::FindFreeSubstituteName(TSmartPath pathSrcPath, TSmartPath pathDstPath) const { - const TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); + const TConfig& rConfig = GetContext().GetConfig(); // get the name from src path pathSrcPath.StripSeparatorAtEnd(); TSmartPath pathFilename = pathSrcPath.GetFileName(); // set the dest path - TString strCheckPath = GetTaskPropValue(rTaskDefinition.GetConfiguration()); + TString strCheckPath = GetTaskPropValue(rConfig); strCheckPath.Replace(_T("%name"), pathFilename.ToString()); TSmartPath pathCheckPath(PathFromString(strCheckPath)); // when adding to strDstPath check if the path already exists - if so - try again int iCounter = 1; - TString strFmt = GetTaskPropValue(rTaskDefinition.GetConfiguration()); + TString strFmt = GetTaskPropValue(rConfig); while(TLocalFilesystem::PathExist(pathDstPath + pathCheckPath)) { strCheckPath = strFmt; Index: src/libchcore/TSubTaskContext.cpp =================================================================== diff -u -N -r12a1725bfd04b0f55fd0fda302975fdcd4174943 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TSubTaskContext.cpp (.../TSubTaskContext.cpp) (revision 12a1725bfd04b0f55fd0fda302975fdcd4174943) +++ src/libchcore/TSubTaskContext.cpp (.../TSubTaskContext.cpp) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -25,12 +25,15 @@ BEGIN_CHCORE_NAMESPACE -TSubTaskContext::TSubTaskContext(TTaskDefinition& rTaskDefinition, TBasePathDataContainer& rBasePathDataContainer, TFileInfoArray& rFilesCache, +TSubTaskContext::TSubTaskContext(TConfig& rConfig, + TBasePathDataContainer& rBasePathDataContainer, TFileInfoArray& rFilesCache, TTaskConfigTracker& rCfgTracker, icpf::log_file& rLog, IFeedbackHandler* piFeedbackHandler, TWorkerThreadController& rThreadController, TLocalFilesystem& rfsLocal) : - m_rTaskDefinition(rTaskDefinition), + m_rConfig(rConfig), + m_eOperationType(eOperation_None), m_rBasePathDataContainer(rBasePathDataContainer), m_rFilesCache(rFilesCache), + m_pathDestination(), m_rCfgTracker(rCfgTracker), m_rLog(rLog), m_piFeedbackHandler(piFeedbackHandler), Index: src/libchcore/TSubTaskContext.h =================================================================== diff -u -N -r12a1725bfd04b0f55fd0fda302975fdcd4174943 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TSubTaskContext.h (.../TSubTaskContext.h) (revision 12a1725bfd04b0f55fd0fda302975fdcd4174943) +++ src/libchcore/TSubTaskContext.h (.../TSubTaskContext.h) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -24,6 +24,8 @@ #define __TSUBTASKCONTEXT_H__ #include "libchcore.h" +#include "TPath.h" +#include "EOperationTypes.h" namespace icpf { @@ -33,35 +35,42 @@ BEGIN_CHCORE_NAMESPACE class IFeedbackHandler; -class TTaskDefinition; class TWorkerThreadController; class TBasePathDataContainer; class TTaskConfigTracker; class TLocalFilesystem; class TTaskLocalStatsInfo; class TTaskBasicProgressInfo; class TFileInfoArray; +class TConfig; /////////////////////////////////////////////////////////////////////////// // TSubTaskContext class LIBCHCORE_API TSubTaskContext { public: - TSubTaskContext(TTaskDefinition& rTaskDefinition, TBasePathDataContainer& rBasePathDataContainer, TFileInfoArray& rFilesCache, + TSubTaskContext(TConfig& rConfig, + TBasePathDataContainer& rBasePathDataContainer, TFileInfoArray& rFilesCache, TTaskConfigTracker& rCfgTracker, icpf::log_file& rLog, IFeedbackHandler* piFeedbackHandler, TWorkerThreadController& rThreadController, TLocalFilesystem& rfsLocal); ~TSubTaskContext(); - TTaskDefinition& GetTaskDefinition() { return m_rTaskDefinition; } - const TTaskDefinition& GetTaskDefinition() const { return m_rTaskDefinition; } + TConfig& GetConfig() { return m_rConfig; } + const TConfig& GetConfig() const { return m_rConfig; } + chcore::EOperationType GetOperationType() const { return m_eOperationType; } + void SetOperationType(chcore::EOperationType eOperationType) { m_eOperationType = eOperationType; } + TBasePathDataContainer& GetBasePathDataContainer() { return m_rBasePathDataContainer; } const TBasePathDataContainer& GetBasePathDataContainer() const { return m_rBasePathDataContainer; } TFileInfoArray& GetFilesCache() { return m_rFilesCache; } const TFileInfoArray& GetFilesCache() const { return m_rFilesCache; } + TSmartPath GetDestinationPath() const { return m_pathDestination; } + void SetDestinationPath(const TSmartPath& pathDestination) { m_pathDestination = pathDestination; } + TTaskConfigTracker& GetCfgTracker() { return m_rCfgTracker; } const TTaskConfigTracker& GetCfgTracker() const { return m_rCfgTracker; } @@ -82,14 +91,18 @@ TSubTaskContext& operator=(const TSubTaskContext& rSrc); private: - TTaskDefinition& m_rTaskDefinition; + TConfig& m_rConfig; + EOperationType m_eOperationType; + // information about input paths TBasePathDataContainer& m_rBasePathDataContainer; // data on which to operate TFileInfoArray& m_rFilesCache; + TSmartPath m_pathDestination; + // configuration changes tracking TTaskConfigTracker& m_rCfgTracker; Index: src/libchcore/TSubTaskCopyMove.cpp =================================================================== diff -u -N -ra5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision a5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8) +++ src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -24,7 +24,6 @@ #include "TSubTaskCopyMove.h" #include "TSubTaskContext.h" #include "TTaskConfiguration.h" -#include "TTaskDefinition.h" #include "TLocalFilesystem.h" #include "DataBuffer.h" #include "../libicpf/log.h" @@ -166,10 +165,11 @@ icpf::log_file& rLog = GetContext().GetLog(); TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); - TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); TTaskConfigTracker& rCfgTracker = GetContext().GetCfgTracker(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); IFeedbackHandler* piFeedbackHandler = GetContext().GetFeedbackHandler(); + const TConfig& rConfig = GetContext().GetConfig(); + TSmartPath pathDestination = GetContext().GetDestinationPath(); BOOST_ASSERT(piFeedbackHandler != NULL); if(piFeedbackHandler == NULL) @@ -193,13 +193,13 @@ // begin at index which wasn't processed previously size_t stSize = rFilesCache.GetSize(); - bool bIgnoreFolders = GetTaskPropValue(rTaskDefinition.GetConfiguration()); - bool bForceDirectories = GetTaskPropValue(rTaskDefinition.GetConfiguration()); + bool bIgnoreFolders = GetTaskPropValue(rConfig); + bool bForceDirectories = GetTaskPropValue(rConfig); // create a buffer of size m_nBufferSize CUSTOM_COPY_PARAMS ccp; ccp.bProcessed = false; - ccp.bOnlyCreate = GetTaskPropValue(rTaskDefinition.GetConfiguration()); + ccp.bOnlyCreate = GetTaskPropValue(rConfig); // remove changes in buffer sizes to avoid re-creation later rCfgTracker.RemoveModificationSet(TOptionsSet() % eTO_DefaultBufferSize % eTO_OneDiskBufferSize % eTO_TwoDisksBufferSize % eTO_CDBufferSize % eTO_LANBufferSize % eTO_UseOnlyDefaultBuffer); @@ -212,7 +212,7 @@ strFormat.Replace(_T("%create"), boost::lexical_cast(ccp.bOnlyCreate).c_str()); strFormat.Replace(_T("%filecount"), boost::lexical_cast(stSize).c_str()); strFormat.Replace(_T("%ignorefolders"), boost::lexical_cast(bIgnoreFolders).c_str()); - strFormat.Replace(_T("%dstpath"), rTaskDefinition.GetDestinationPath().ToString()); + strFormat.Replace(_T("%dstpath"), pathDestination.ToString()); strFormat.Replace(_T("%currindex"), boost::lexical_cast(m_tProgressInfo.GetCurrentIndex()).c_str()); rLog.logi(strFormat); @@ -241,10 +241,10 @@ m_tSubTaskStats.SetCurrentItemTotalSize(spFileInfo->GetLength64()); // set dest path with filename - ccp.pathDstFile = CalculateDestinationPath(spFileInfo, rTaskDefinition.GetDestinationPath(), ((int)bForceDirectories) << 1 | (int)bIgnoreFolders); + ccp.pathDstFile = CalculateDestinationPath(spFileInfo, pathDestination, ((int)bForceDirectories) << 1 | (int)bIgnoreFolders); // are the files/folders lie on the same partition ? - bool bMove = rTaskDefinition.GetOperationType() == eOperation_Move; + bool bMove = GetContext().GetOperationType() == eOperation_Move; // if folder - create it if(spFileInfo->IsDirectory()) @@ -273,21 +273,21 @@ spFileInfo->SetFlags(ccp.bProcessed ? FIF_PROCESSED : 0, FIF_PROCESSED); // if moving - delete file (only if config flag is set) - if(bMove && spFileInfo->GetFlags() & FIF_PROCESSED && !GetTaskPropValue(rTaskDefinition.GetConfiguration())) + if(bMove && spFileInfo->GetFlags() & FIF_PROCESSED && !GetTaskPropValue(rConfig)) { - if(!GetTaskPropValue(rTaskDefinition.GetConfiguration())) + if(!GetTaskPropValue(rConfig)) TLocalFilesystem::SetAttributes(spFileInfo->GetFullFilePath(), FILE_ATTRIBUTE_NORMAL); TLocalFilesystem::DeleteFile(spFileInfo->GetFullFilePath()); // there will be another try later, so we don't check // if succeeded } } // set a time - if(GetTaskPropValue(rTaskDefinition.GetConfiguration())) + if(GetTaskPropValue(rConfig)) TLocalFilesystem::SetFileDirectoryTime(ccp.pathDstFile, spFileInfo->GetCreationTime(), spFileInfo->GetLastAccessTime(), spFileInfo->GetLastWriteTime()); // no error checking (but most probably it should be checked) // attributes - if(GetTaskPropValue(rTaskDefinition.GetConfiguration())) + if(GetTaskPropValue(rConfig)) TLocalFilesystem::SetAttributes(ccp.pathDstFile, spFileInfo->GetAttributes()); // as above } @@ -323,7 +323,7 @@ THROW_CORE_EXCEPTION(eErr_InvalidArgument); TSmartPath pathSource = spFileInfo->GetFullFilePath(); - TSmartPath pathDestination = GetContext().GetTaskDefinition().GetDestinationPath(); + TSmartPath pathDestination = GetContext().GetDestinationPath(); TLocalFilesystem::EPathsRelation eRelation = GetContext().GetLocalFilesystem().GetPathsRelation(pathSource, pathDestination); switch(eRelation) @@ -348,9 +348,9 @@ TSubTaskBase::ESubOperationResult TSubTaskCopyMove::CustomCopyFileFB(CUSTOM_COPY_PARAMS* pData) { - TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); icpf::log_file& rLog = GetContext().GetLog(); + const TConfig& rConfig = GetContext().GetConfig(); TLocalFilesystemFile fileSrc = TLocalFilesystem::CreateFileObject(); TLocalFilesystemFile fileDst = TLocalFilesystem::CreateFileObject(); @@ -362,8 +362,8 @@ // NOTE: we are using here the file size read when scanning directories for files; it might be // outdated at this point, but at present we don't want to re-read file size since it // will cost additional disk access - bool bNoBuffer = (GetTaskPropValue(rTaskDefinition.GetConfiguration()) && - pData->spSrcFile->GetLength64() >= GetTaskPropValue(rTaskDefinition.GetConfiguration())); + bool bNoBuffer = (GetTaskPropValue(rConfig) && + pData->spSrcFile->GetLength64() >= GetTaskPropValue(rConfig)); bool bSkip = false; eResult = OpenSrcAndDstFilesFB(pData, fileSrc, fileDst, bNoBuffer, bSkip); @@ -488,7 +488,7 @@ TSubTaskCopyMove::ESubOperationResult TSubTaskCopyMove::OpenSrcAndDstFilesFB(CUSTOM_COPY_PARAMS* pData, TLocalFilesystemFile &fileSrc, TLocalFilesystemFile &fileDst, bool bNoBuffer, bool& bSkip) { - TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); + const TConfig& rConfig = GetContext().GetConfig(); bSkip = false; @@ -511,7 +511,7 @@ // change attributes of a dest file // NOTE: probably should be removed from here and report problems with read-only files // directly to the user (as feedback request) - if(!GetTaskPropValue(rTaskDefinition.GetConfiguration())) + if(!GetTaskPropValue(rConfig)) SetFileAttributes(pData->pathDstFile.ToString(), FILE_ATTRIBUTE_NORMAL); // open destination file, handle the failures and possibly existence of the destination file @@ -623,18 +623,18 @@ bool TSubTaskCopyMove::AdjustBufferIfNeeded(chcore::TDataBufferManager& rBuffer, TBufferSizes& rBufferSizes) { + const TConfig& rConfig = GetContext().GetConfig(); TTaskConfigTracker& rCfgTracker = GetContext().GetCfgTracker(); - TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); icpf::log_file& rLog = GetContext().GetLog(); if(!rBuffer.IsInitialized() || (rCfgTracker.IsModified() && rCfgTracker.IsModified(TOptionsSet() % eTO_DefaultBufferSize % eTO_OneDiskBufferSize % eTO_TwoDisksBufferSize % eTO_CDBufferSize % eTO_LANBufferSize % eTO_UseOnlyDefaultBuffer, true))) { - rBufferSizes.SetOnlyDefault(GetTaskPropValue(rTaskDefinition.GetConfiguration())); - rBufferSizes.SetDefaultSize(GetTaskPropValue(rTaskDefinition.GetConfiguration())); - rBufferSizes.SetOneDiskSize(GetTaskPropValue(rTaskDefinition.GetConfiguration())); - rBufferSizes.SetTwoDisksSize(GetTaskPropValue(rTaskDefinition.GetConfiguration())); - rBufferSizes.SetCDSize(GetTaskPropValue(rTaskDefinition.GetConfiguration())); - rBufferSizes.SetLANSize(GetTaskPropValue(rTaskDefinition.GetConfiguration())); + rBufferSizes.SetOnlyDefault(GetTaskPropValue(rConfig)); + rBufferSizes.SetDefaultSize(GetTaskPropValue(rConfig)); + rBufferSizes.SetOneDiskSize(GetTaskPropValue(rConfig)); + rBufferSizes.SetTwoDisksSize(GetTaskPropValue(rConfig)); + rBufferSizes.SetCDSize(GetTaskPropValue(rConfig)); + rBufferSizes.SetLANSize(GetTaskPropValue(rConfig)); // log TString strFormat; @@ -651,8 +651,8 @@ if(!rBuffer.IsInitialized()) { size_t stMaxSize = rBufferSizes.GetMaxSize(); - size_t stPageSize = GetTaskPropValue(rTaskDefinition.GetConfiguration()); - size_t stChunkSize = GetTaskPropValue(rTaskDefinition.GetConfiguration()); + size_t stPageSize = GetTaskPropValue(rConfig); + size_t stChunkSize = GetTaskPropValue(rConfig); chcore::TDataBufferManager::CheckBufferConfig(stMaxSize, stPageSize, stChunkSize); @@ -1230,10 +1230,11 @@ TSubTaskBase::ESubOperationResult TSubTaskCopyMove::CheckForFreeSpaceFB() { icpf::log_file& rLog = GetContext().GetLog(); - TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); IFeedbackHandler* piFeedbackHandler = GetContext().GetFeedbackHandler(); TLocalFilesystem& rLocalFilesystem = GetContext().GetLocalFilesystem(); TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); + const TPathContainer& rSrcPaths = GetContext().GetBasePathDataContainer().GetBasePaths(); + TSmartPath pathDestination = GetContext().GetDestinationPath(); ull_t ullNeededSize = 0, ullAvailableSize = 0; bool bRetry = false; @@ -1247,17 +1248,17 @@ ullNeededSize = rFilesCache.CalculateTotalSize() - rFilesCache.CalculatePartialSize(m_tProgressInfo.GetCurrentIndex()); // it'd be nice to round up to take cluster size into consideration // get free space - bool bResult = rLocalFilesystem.GetDynamicFreeSpace(rTaskDefinition.GetDestinationPath(), ullAvailableSize); + bool bResult = rLocalFilesystem.GetDynamicFreeSpace(pathDestination, ullAvailableSize); if(bResult && ullNeededSize > ullAvailableSize) { TString strFormat = _T("Not enough free space on disk - needed %needsize bytes for data, available: %availablesize bytes."); strFormat.Replace(_t("%needsize"), boost::lexical_cast(ullNeededSize).c_str()); strFormat.Replace(_t("%availablesize"), boost::lexical_cast(ullAvailableSize).c_str()); rLog.logw(strFormat); - if(rTaskDefinition.GetSourcePathCount() > 0) + if(!rSrcPaths.IsEmpty()) { - FEEDBACK_NOTENOUGHSPACE feedStruct = { ullNeededSize, rTaskDefinition.GetSourcePathAt(0).ToString(), rTaskDefinition.GetDestinationPath().ToString() }; + FEEDBACK_NOTENOUGHSPACE feedStruct = { ullNeededSize, rSrcPaths.GetAt(0).ToString(), pathDestination.ToString() }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)piFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_NotEnoughSpace, &feedStruct); // default Index: src/libchcore/TSubTaskDelete.cpp =================================================================== diff -u -N -ra5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision a5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8) +++ src/libchcore/TSubTaskDelete.cpp (.../TSubTaskDelete.cpp) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -25,7 +25,6 @@ #include "TSubTaskContext.h" #include "TWorkerThreadController.h" #include "TTaskConfiguration.h" -#include "TTaskDefinition.h" #include "TLocalFilesystem.h" #include "..\libicpf\log.h" #include "FeedbackHandlerBase.h" @@ -114,9 +113,9 @@ // log icpf::log_file& rLog = GetContext().GetLog(); TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); - TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); IFeedbackHandler* piFeedbackHandler = GetContext().GetFeedbackHandler(); + const TConfig& rConfig = GetContext().GetConfig(); // log rLog.logi(_T("Deleting files (DeleteFiles)...")); @@ -164,14 +163,14 @@ // delete data if(spFileInfo->IsDirectory()) { - if(!GetTaskPropValue(rTaskDefinition.GetConfiguration())) + if(!GetTaskPropValue(rConfig)) TLocalFilesystem::SetAttributes(spFileInfo->GetFullFilePath(), FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_DIRECTORY); bSuccess = TLocalFilesystem::RemoveDirectory(spFileInfo->GetFullFilePath()); } else { // set files attributes to normal - it'd slow processing a bit, but it's better. - if(!GetTaskPropValue(rTaskDefinition.GetConfiguration())) + if(!GetTaskPropValue(rConfig)) TLocalFilesystem::SetAttributes(spFileInfo->GetFullFilePath(), FILE_ATTRIBUTE_NORMAL); bSuccess = TLocalFilesystem::DeleteFile(spFileInfo->GetFullFilePath()); } Index: src/libchcore/TSubTaskFastMove.cpp =================================================================== diff -u -N -ra5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision a5f396da5ed5ffb3fcd9fdf22afb5a7fd07e1ab8) +++ src/libchcore/TSubTaskFastMove.cpp (.../TSubTaskFastMove.cpp) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -25,7 +25,6 @@ #include #include "TSubTaskContext.h" #include "TTaskConfiguration.h" -#include "TTaskDefinition.h" #include "TLocalFilesystem.h" #include "FeedbackHandlerBase.h" #include "TBasePathData.h" @@ -115,30 +114,29 @@ // log icpf::log_file& rLog = GetContext().GetLog(); - TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); IFeedbackHandler* piFeedbackHandler = GetContext().GetFeedbackHandler(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); TBasePathDataContainer& rBasePathDataContainer = GetContext().GetBasePathDataContainer(); + const TConfig& rConfig = GetContext().GetConfig(); + TSmartPath pathDestination = GetContext().GetDestinationPath(); rLog.logi(_T("Performing initial fast-move operation...")); // new stats m_tSubTaskStats.SetCurrentBufferIndex(TBufferSizes::eBuffer_Default); - m_tSubTaskStats.SetTotalCount(rTaskDefinition.GetSourcePathCount()); + m_tSubTaskStats.SetTotalCount(rBasePathDataContainer.GetBasePaths().GetCount()); m_tSubTaskStats.SetProcessedCount(0); m_tSubTaskStats.SetTotalSize(0); m_tSubTaskStats.SetProcessedSize(0); m_tSubTaskStats.SetCurrentPath(TString()); // read filtering options TFileFiltersArray afFilters; - GetTaskPropValue(rTaskDefinition.GetConfiguration(), afFilters); + GetTaskPropValue(rConfig, afFilters); - //wchar_t wchDestinationDriveLetter = rTaskDefinition.GetDestinationPath().GetDriveLetter(); + bool bIgnoreDirs = GetTaskPropValue(rConfig); + bool bForceDirectories = GetTaskPropValue(rConfig); - bool bIgnoreDirs = GetTaskPropValue(rTaskDefinition.GetConfiguration()); - bool bForceDirectories = GetTaskPropValue(rTaskDefinition.GetConfiguration()); - // when using special options with move operation, we don't want to use fast-moving, since most probably // some searching and special processing needs to be done if(bIgnoreDirs || bForceDirectories) @@ -149,11 +147,11 @@ bool bRetry = true; bool bSkipInputPath = false; - size_t stSize = rTaskDefinition.GetSourcePathCount(); + size_t stSize = rBasePathDataContainer.GetBasePaths().GetCount(); size_t stIndex = m_tProgressInfo.GetCurrentIndex(); for(; stIndex < stSize ; stIndex++) { - TSmartPath pathCurrent = rTaskDefinition.GetSourcePathAt(stIndex); + TSmartPath pathCurrent = rBasePathDataContainer.GetBasePaths().GetAt(stIndex); // store currently processed index m_tProgressInfo.SetCurrentIndex(stIndex); @@ -179,7 +177,7 @@ bRetry = false; // read attributes of src file/folder - bool bExists = TLocalFilesystem::GetFileInfo(pathCurrent, spFileInfo, stIndex, &rTaskDefinition.GetSourcePaths()); + bool bExists = TLocalFilesystem::GetFileInfo(pathCurrent, spFileInfo, stIndex, &rBasePathDataContainer.GetBasePaths()); if(!bExists) { FEEDBACK_FILEERROR ferr = { pathCurrent.ToString(), NULL, eFastMoveError, ERROR_FILE_NOT_FOUND }; @@ -224,8 +222,9 @@ bool bResult = true; do { - TSmartPath pathDestinationPath = CalculateDestinationPath(spFileInfo, rTaskDefinition.GetDestinationPath(), 0); - bResult = TLocalFilesystem::FastMove(rTaskDefinition.GetSourcePathAt(stIndex), pathDestinationPath); + TSmartPath pathDestinationPath = CalculateDestinationPath(spFileInfo, pathDestination, 0); + TSmartPath pathSrc = rBasePathDataContainer.GetBasePaths().GetAt(stIndex); + bResult = TLocalFilesystem::FastMove(pathSrc, pathDestinationPath); if(!bResult) { DWORD dwLastError = GetLastError(); @@ -242,10 +241,10 @@ 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()); + strFormat.Replace(_T("%dstpath"), pathDestination.ToString()); rLog.loge(strFormat); - FEEDBACK_FILEERROR ferr = { rTaskDefinition.GetSourcePathAt(stIndex).ToString(), pathDestinationPath.ToString(), eFastMoveError, dwLastError }; + FEEDBACK_FILEERROR ferr = { pathSrc.ToString(), pathDestinationPath.ToString(), eFastMoveError, dwLastError }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)piFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); switch(frResult) { Index: src/libchcore/TSubTaskScanDirectory.cpp =================================================================== diff -u -N -rac31856afa94b39abcd807b503fa9797ad8b75a9 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision ac31856afa94b39abcd807b503fa9797ad8b75a9) +++ src/libchcore/TSubTaskScanDirectory.cpp (.../TSubTaskScanDirectory.cpp) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -24,7 +24,6 @@ #include "TSubTaskScanDirectory.h" #include "TSubTaskContext.h" #include "TTaskConfiguration.h" -#include "TTaskDefinition.h" #include "TLocalFilesystem.h" #include "FeedbackHandlerBase.h" #include "TBasePathData.h" @@ -118,10 +117,11 @@ // log icpf::log_file& rLog = GetContext().GetLog(); TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); - TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); IFeedbackHandler* piFeedbackHandler = GetContext().GetFeedbackHandler(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); TBasePathDataContainer& rBasePathDataContainer = GetContext().GetBasePathDataContainer(); + const TPathContainer& rBasePaths = rBasePathDataContainer.GetBasePaths(); + const TConfig& rConfig = GetContext().GetConfig(); rLog.logi(_T("Searching for files...")); @@ -130,7 +130,7 @@ // new stats m_tSubTaskStats.SetCurrentBufferIndex(TBufferSizes::eBuffer_Default); - m_tSubTaskStats.SetTotalCount(rTaskDefinition.GetSourcePathCount()); + m_tSubTaskStats.SetTotalCount(rBasePaths.GetCount()); m_tSubTaskStats.SetProcessedCount(0); m_tSubTaskStats.SetTotalSize(0); m_tSubTaskStats.SetProcessedSize(0); @@ -141,22 +141,22 @@ // read filtering options TFileFiltersArray afFilters; - GetTaskPropValue(rTaskDefinition.GetConfiguration(), afFilters); + GetTaskPropValue(rConfig, afFilters); - bool bIgnoreDirs = GetTaskPropValue(rTaskDefinition.GetConfiguration()); - bool bForceDirectories = GetTaskPropValue(rTaskDefinition.GetConfiguration()); + bool bIgnoreDirs = GetTaskPropValue(rConfig); + bool bForceDirectories = GetTaskPropValue(rConfig); // add everything TString strFormat; bool bRetry = true; bool bSkipInputPath = false; - size_t stSize = rTaskDefinition.GetSourcePathCount(); + size_t stSize = rBasePaths.GetCount(); // NOTE: in theory, we should resume the scanning, but in practice we are always restarting scanning if interrupted. size_t stIndex = 0; // m_tProgressInfo.GetCurrentIndex() for(; stIndex < stSize; stIndex++) { - TSmartPath pathCurrent = rTaskDefinition.GetSourcePathAt(stIndex); + TSmartPath pathCurrent = rBasePaths.GetAt(stIndex); m_tProgressInfo.SetCurrentIndex(stIndex); @@ -182,10 +182,10 @@ bRetry = false; // read attributes of src file/folder - bool bExists = TLocalFilesystem::GetFileInfo(pathCurrent, spFileInfo, stIndex, &rTaskDefinition.GetSourcePaths()); + bool bExists = TLocalFilesystem::GetFileInfo(pathCurrent, spFileInfo, stIndex, &rBasePaths); if(!bExists) { - FEEDBACK_FILEERROR ferr = { rTaskDefinition.GetSourcePathAt(stIndex).ToString(), NULL, eFastMoveError, ERROR_FILE_NOT_FOUND }; + FEEDBACK_FILEERROR ferr = { rBasePaths.GetAt(stIndex).ToString(), NULL, eFastMoveError, ERROR_FILE_NOT_FOUND }; IFeedbackHandler::EFeedbackResult frResult = (IFeedbackHandler::EFeedbackResult)piFeedbackHandler->RequestFeedback(IFeedbackHandler::eFT_FileError, &ferr); switch(frResult) { @@ -219,7 +219,7 @@ // log strFormat = _T("Adding file/folder (clipboard) : %path ..."); - strFormat.Replace(_T("%path"), rTaskDefinition.GetSourcePathAt(stIndex).ToString()); + strFormat.Replace(_T("%path"), rBasePaths.GetAt(stIndex).ToString()); rLog.logi(strFormat); // add if needed @@ -290,8 +290,8 @@ int TSubTaskScanDirectories::ScanDirectory(TSmartPath pathDirName, size_t stSrcIndex, bool bRecurse, bool bIncludeDirs, TFileFiltersArray& afFilters) { TFileInfoArray& rFilesCache = GetContext().GetFilesCache(); - TTaskDefinition& rTaskDefinition = GetContext().GetTaskDefinition(); TWorkerThreadController& rThreadController = GetContext().GetThreadController(); + const TPathContainer& rBasePaths = GetContext().GetBasePathDataContainer().GetBasePaths(); TLocalFilesystemFind finder = TLocalFilesystem::CreateFinderObject(pathDirName, PathFromString(_T("*"))); TFileInfoPtr spFileInfo(boost::make_shared()); @@ -305,7 +305,7 @@ { if(afFilters.Match(spFileInfo)) { - spFileInfo->SetParentObject(stSrcIndex, &rTaskDefinition.GetSourcePaths()); + spFileInfo->SetParentObject(stSrcIndex, &rBasePaths); rFilesCache.AddFileInfo(spFileInfo); spFileInfo = boost::make_shared(); } @@ -315,7 +315,7 @@ TSmartPath pathCurrent = spFileInfo->GetFullFilePath(); if(bIncludeDirs) { - spFileInfo->SetParentObject(stSrcIndex, &rTaskDefinition.GetSourcePaths()); + spFileInfo->SetParentObject(stSrcIndex, &rBasePaths); rFilesCache.AddFileInfo(spFileInfo); spFileInfo = boost::make_shared(); } Index: src/libchcore/TTask.cpp =================================================================== diff -u -N -rb1ecc12ba4c1f2a7b4acd6e82fc4193535e55ff0 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TTask.cpp (.../TTask.cpp) (revision b1ecc12ba4c1f2a7b4acd6e82fc4193535e55ff0) +++ src/libchcore/TTask.cpp (.../TTask.cpp) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -43,12 +43,12 @@ TTask::TTask(const ITaskSerializerPtr& spSerializer, IFeedbackHandler* piFeedbackHandler) : m_log(), m_piFeedbackHandler(piFeedbackHandler), - m_arrSourcePathsInfo(m_tTaskDefinition.GetSourcePaths()), - m_files(m_tTaskDefinition.GetSourcePaths()), + m_arrSourcePathsInfo(m_vSourcePaths), + m_files(m_vSourcePaths), m_bForce(false), m_bContinue(false), m_eCurrentState(eTaskState_None), - m_tSubTaskContext(m_tTaskDefinition, m_arrSourcePathsInfo, m_files, m_cfgTracker, m_log, piFeedbackHandler, m_workerThread, m_fsLocal), + m_tSubTaskContext(m_tConfiguration, m_arrSourcePathsInfo, m_files, m_cfgTracker, m_log, piFeedbackHandler, m_workerThread, m_fsLocal), m_tSubTasksArray(), m_spSerializer(spSerializer) { @@ -64,11 +64,16 @@ void TTask::SetTaskDefinition(const TTaskDefinition& rTaskDefinition) { - m_tTaskDefinition = rTaskDefinition; + m_pathDestinationPath = rTaskDefinition.GetDestinationPath(); + m_tConfiguration = rTaskDefinition.GetConfiguration(); + m_vSourcePaths = rTaskDefinition.GetSourcePaths(); + m_strTaskName = rTaskDefinition.GetTaskName(); - m_tSubTasksArray.Init(m_tTaskDefinition.GetOperationPlan(), m_tSubTaskContext); - m_arrSourcePathsInfo.SetCount(m_tTaskDefinition.GetSourcePathCount()); + m_tSubTasksArray.Init(rTaskDefinition.GetOperationPlan(), m_tSubTaskContext); + m_arrSourcePathsInfo.SetCount(m_vSourcePaths.GetCount()); m_files.Clear(); + m_tSubTaskContext.SetOperationType(m_tSubTasksArray.GetOperationType()); + m_tSubTaskContext.SetDestinationPath(m_pathDestinationPath); } void TTask::OnRegisterTask() @@ -94,30 +99,30 @@ void TTask::SetBufferSizes(const TBufferSizes& bsSizes) { - m_tTaskDefinition.GetConfiguration().DelayNotifications(); - SetTaskPropValue(m_tTaskDefinition.GetConfiguration(), bsSizes.GetDefaultSize()); - SetTaskPropValue(m_tTaskDefinition.GetConfiguration(), bsSizes.GetOneDiskSize()); - SetTaskPropValue(m_tTaskDefinition.GetConfiguration(), bsSizes.GetTwoDisksSize()); - SetTaskPropValue(m_tTaskDefinition.GetConfiguration(), bsSizes.GetCDSize()); - SetTaskPropValue(m_tTaskDefinition.GetConfiguration(), bsSizes.GetLANSize()); - SetTaskPropValue(m_tTaskDefinition.GetConfiguration(), bsSizes.IsOnlyDefault()); - m_tTaskDefinition.GetConfiguration().ResumeNotifications(); + m_tConfiguration.DelayNotifications(); + SetTaskPropValue(m_tConfiguration, bsSizes.GetDefaultSize()); + SetTaskPropValue(m_tConfiguration, bsSizes.GetOneDiskSize()); + SetTaskPropValue(m_tConfiguration, bsSizes.GetTwoDisksSize()); + SetTaskPropValue(m_tConfiguration, bsSizes.GetCDSize()); + SetTaskPropValue(m_tConfiguration, bsSizes.GetLANSize()); + SetTaskPropValue(m_tConfiguration, bsSizes.IsOnlyDefault()); + m_tConfiguration.ResumeNotifications(); } void TTask::GetBufferSizes(TBufferSizes& bsSizes) { - bsSizes.SetDefaultSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); - bsSizes.SetOneDiskSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); - bsSizes.SetTwoDisksSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); - bsSizes.SetCDSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); - bsSizes.SetLANSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); - bsSizes.SetOnlyDefault(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); + bsSizes.SetDefaultSize(GetTaskPropValue(m_tConfiguration)); + bsSizes.SetOneDiskSize(GetTaskPropValue(m_tConfiguration)); + bsSizes.SetTwoDisksSize(GetTaskPropValue(m_tConfiguration)); + bsSizes.SetCDSize(GetTaskPropValue(m_tConfiguration)); + bsSizes.SetLANSize(GetTaskPropValue(m_tConfiguration)); + bsSizes.SetOnlyDefault(GetTaskPropValue(m_tConfiguration)); } // thread void TTask::SetPriority(int nPriority) { - SetTaskPropValue(m_tTaskDefinition.GetConfiguration(), nPriority); + SetTaskPropValue(m_tConfiguration, nPriority); } void TTask::Load() @@ -135,7 +140,7 @@ // update members according to the task definition // make sure to resize paths info array size to match source paths count m_arrSourcePathsInfo.SetCount(m_tTaskDefinition.GetSourcePathCount()); - GetTaskPropValue(m_tTaskDefinition.GetConfiguration(), m_afFilters); + GetTaskPropValue(m_tConfiguration, m_afFilters); //////////////////////////////// // now rarely changing task progress data @@ -241,7 +246,7 @@ { boost::unique_lock lock(m_lock); - m_workerThread.StartThread(DelegateThreadProc, this, GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); + m_workerThread.StartThread(DelegateThreadProc, this, GetTaskPropValue(m_tConfiguration)); } void TTask::ResumeProcessing() @@ -307,35 +312,35 @@ m_tLocalStats.GetSnapshot(spSnapshot); - spSnapshot->SetTaskName(m_tTaskDefinition.GetTaskName()); - spSnapshot->SetThreadPriority(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); - spSnapshot->SetDestinationPath(m_tTaskDefinition.GetDestinationPath().ToString()); + spSnapshot->SetTaskName(m_strTaskName); + spSnapshot->SetThreadPriority(GetTaskPropValue(m_tConfiguration)); + spSnapshot->SetDestinationPath(m_pathDestinationPath.ToString()); spSnapshot->SetFilters(m_afFilters); spSnapshot->SetTaskState(m_eCurrentState); - spSnapshot->SetOperationType(m_tTaskDefinition.GetOperationType()); + spSnapshot->SetOperationType(m_tSubTasksArray.GetOperationType()); - spSnapshot->SetIgnoreDirectories(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); - spSnapshot->SetCreateEmptyFiles(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); + spSnapshot->SetIgnoreDirectories(GetTaskPropValue(m_tConfiguration)); + spSnapshot->SetCreateEmptyFiles(GetTaskPropValue(m_tConfiguration)); TSubTaskStatsSnapshotPtr spCurrentSubTask = spSnapshot->GetSubTasksStats().GetCurrentSubTaskSnapshot(); int iCurrentBufferIndex = spCurrentSubTask ? spCurrentSubTask->GetCurrentBufferIndex() : TBufferSizes::eBuffer_Default; switch(iCurrentBufferIndex) { case TBufferSizes::eBuffer_Default: - spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); + spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tConfiguration)); break; case TBufferSizes::eBuffer_OneDisk: - spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); + spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tConfiguration)); break; case TBufferSizes::eBuffer_TwoDisks: - spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); + spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tConfiguration)); break; case TBufferSizes::eBuffer_CD: - spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); + spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tConfiguration)); break; case TBufferSizes::eBuffer_LAN: - spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); + spSnapshot->SetCurrentBufferSize(GetTaskPropValue(m_tConfiguration)); break; default: THROW_CORE_EXCEPTION(eErr_UnhandledCase); @@ -462,15 +467,15 @@ OnBeginOperation(); // enable configuration changes tracking - m_tTaskDefinition.GetConfiguration().ConnectToNotifier(TTaskConfigTracker::NotificationProc, &m_cfgTracker); - m_tTaskDefinition.GetConfiguration().ConnectToNotifier(TTask::OnCfgOptionChanged, this); + m_tConfiguration.ConnectToNotifier(TTaskConfigTracker::NotificationProc, &m_cfgTracker); + m_tConfiguration.ConnectToNotifier(TTask::OnCfgOptionChanged, this); // set thread options HANDLE hThread = GetCurrentThread(); - ::SetThreadPriorityBoost(hThread, GetTaskPropValue(m_tTaskDefinition.GetConfiguration())); + ::SetThreadPriorityBoost(hThread, GetTaskPropValue(m_tConfiguration)); // determine when to scan directories - bool bReadTasksSize = GetTaskPropValue(m_tTaskDefinition.GetConfiguration()); + bool bReadTasksSize = GetTaskPropValue(m_tConfiguration); // prepare context for subtasks if(bReadTasksSize) @@ -535,8 +540,8 @@ SetContinueFlag(false); SetForceFlag(false); - m_tTaskDefinition.GetConfiguration().DisconnectFromNotifier(TTaskConfigTracker::NotificationProc); - m_tTaskDefinition.GetConfiguration().DisconnectFromNotifier(TTask::OnCfgOptionChanged); + m_tConfiguration.DisconnectFromNotifier(TTaskConfigTracker::NotificationProc); + m_tConfiguration.DisconnectFromNotifier(TTask::OnCfgOptionChanged); // and the real end OnEndOperation(); @@ -547,8 +552,8 @@ { } - m_tTaskDefinition.GetConfiguration().DisconnectFromNotifier(TTaskConfigTracker::NotificationProc); - m_tTaskDefinition.GetConfiguration().DisconnectFromNotifier(TTask::OnCfgOptionChanged); + m_tConfiguration.DisconnectFromNotifier(TTaskConfigTracker::NotificationProc); + m_tConfiguration.DisconnectFromNotifier(TTask::OnCfgOptionChanged); // log m_log.loge(_T("Caught exception in ThrdProc")); @@ -609,7 +614,7 @@ if(rsetChanges.HasValue(TaskPropData::GetPropertyName())) { - pTask->m_workerThread.ChangePriority(GetTaskPropValue(pTask->GetTaskDefinition().GetConfiguration())); + pTask->m_workerThread.ChangePriority(GetTaskPropValue(pTask->m_tConfiguration)); } } Index: src/libchcore/TTask.h =================================================================== diff -u -N -rb1ecc12ba4c1f2a7b4acd6e82fc4193535e55ff0 -r9ba9390b8f79c7a3fd1f9d6d9e92038d92222621 --- src/libchcore/TTask.h (.../TTask.h) (revision b1ecc12ba4c1f2a7b4acd6e82fc4193535e55ff0) +++ src/libchcore/TTask.h (.../TTask.h) (revision 9ba9390b8f79c7a3fd1f9d6d9e92038d92222621) @@ -50,8 +50,6 @@ public: ~TTask(); - const TTaskDefinition& GetTaskDefinition() const { return m_tTaskDefinition; } - void SetTaskState(ETaskCurrentState eTaskState); ETaskCurrentState GetTaskState() const; @@ -132,10 +130,17 @@ ITaskSerializerPtr m_spSerializer; #pragma warning(pop) - // task initial information (needed to start a task); might be a bit processed. - TTaskDefinition m_tTaskDefinition; + TString m_strTaskName; + // basic information + TPathContainer m_vSourcePaths; + TSmartPath m_pathDestinationPath; + + // Global task settings + TConfig m_tConfiguration; + TSubTasksArray m_tSubTasksArray; + TSubTaskContext m_tSubTaskContext; TTaskConfigTracker m_cfgTracker;