Index: src/ch/MainWnd.cpp =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -r98791237b8511ff19aa54dc3c6901222287d9914 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 98791237b8511ff19aa54dc3c6901222287d9914) @@ -516,15 +516,13 @@ tTaskDefinition.SetOperationType(bMove ? eOperation_Move : eOperation_Copy); - TTaskBasicConfiguration tTaskConfig; - tTaskConfig.SetCreateEmptyFiles(bOnlyCreate != FALSE); - tTaskConfig.SetCreateOnlyDirectories(bForceDirectories != FALSE); - tTaskConfig.SetIgnoreDirectories(bIgnoreDirs != FALSE); + tTaskDefinition.GetConfiguration().GetCopyMoveConfig().SetCreateEmptyFiles(bOnlyCreate != FALSE); + tTaskDefinition.GetConfiguration().GetCopyMoveConfig().SetCreateOnlyDirectories(bForceDirectories != FALSE); + tTaskDefinition.GetConfiguration().GetCopyMoveConfig().SetIgnoreDirectories(bIgnoreDirs != FALSE); CTaskPtr spTask = m_tasks.CreateTask(); spTask->SetTaskDefinition(tTaskDefinition); - spTask->SetTaskBasicConfiguration(tTaskConfig); // set some stuff related with task spTask->SetBufferSizes(&bsSizes); @@ -605,16 +603,12 @@ // new task CTaskPtr spTask = m_tasks.CreateTask(); + tTaskDefinition.GetConfiguration().GetCopyMoveConfig().SetCreateEmptyFiles(dlg.m_ccData.m_bCreateStructure); + tTaskDefinition.GetConfiguration().GetCopyMoveConfig().SetCreateOnlyDirectories(dlg.m_ccData.m_bForceDirectories); + tTaskDefinition.GetConfiguration().GetCopyMoveConfig().SetIgnoreDirectories(dlg.m_ccData.m_bIgnoreFolders); + spTask->SetTaskDefinition(tTaskDefinition); - // special status - TTaskBasicConfiguration tTaskConfig; - tTaskConfig.SetCreateEmptyFiles(dlg.m_ccData.m_bCreateStructure); - tTaskConfig.SetCreateOnlyDirectories(dlg.m_ccData.m_bForceDirectories); - tTaskConfig.SetIgnoreDirectories(dlg.m_ccData.m_bIgnoreFolders); - - spTask->SetTaskBasicConfiguration(tTaskConfig); - spTask->SetBufferSizes(&dlg.m_ccData.m_bsSizes); spTask->SetPriority(dlg.m_ccData.m_iPriority); spTask->SetFilters(&dlg.m_ccData.m_afFilters); Index: src/ch/TTaskConfiguration.h =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -r98791237b8511ff19aa54dc3c6901222287d9914 --- src/ch/TTaskConfiguration.h (.../TTaskConfiguration.h) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/TTaskConfiguration.h (.../TTaskConfiguration.h) (revision 98791237b8511ff19aa54dc3c6901222287d9914) @@ -226,10 +226,16 @@ ~TTaskConfiguration(); const TSubTaskCommonConfig& GetCommonConfig() const { return m_tCommonConfig; } + TSubTaskCommonConfig& GetCommonConfig() { return m_tCommonConfig; } + const TSubTaskScanDirectoriesConfig& GetScanDirectoriesConfig() const { return m_tScanDirectoriesConfig; } + TSubTaskScanDirectoriesConfig& GetScanDirectoriesConfig() { return m_tScanDirectoriesConfig; } + const TSubTaskCopyMoveConfig& GetCopyMoveConfig() const { return m_tCopyMoveConfig; } -// const TSubTaskDeleteConfig& GetDeleteConfig() const { return m_tDeleteConfig; } + TSubTaskCopyMoveConfig& GetCopyMoveConfig() { return m_tCopyMoveConfig; } + // const TSubTaskDeleteConfig& GetDeleteConfig() const { return m_tDeleteConfig; } + template void serialize(Archive& ar, unsigned int /*uiVersion*/) { Index: src/ch/task.cpp =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -r98791237b8511ff19aa54dc3c6901222287d9914 --- src/ch/task.cpp (.../task.cpp) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/task.cpp (.../task.cpp) (revision 98791237b8511ff19aa54dc3c6901222287d9914) @@ -418,57 +418,6 @@ } //////////////////////////////////////////////////////////////////////////// -// class TTaskBasicConfiguration - -TTaskBasicConfiguration::TTaskBasicConfiguration() : - m_iConfigFlags(eFlag_None) -{ -} - -TTaskBasicConfiguration::~TTaskBasicConfiguration() -{ -} - -bool TTaskBasicConfiguration::GetIgnoreDirectories() const -{ - return m_iConfigFlags & eFlag_IgnoreDirectories; -} - -void TTaskBasicConfiguration::SetIgnoreDirectories(bool bIgnoreDirectories) -{ - if(bIgnoreDirectories) - m_iConfigFlags |= eFlag_IgnoreDirectories; - else - m_iConfigFlags &= ~eFlag_IgnoreDirectories; -} - -bool TTaskBasicConfiguration::GetCreateEmptyFiles() const -{ - return m_iConfigFlags & eFlag_CreateEmptyFiles; -} - -void TTaskBasicConfiguration::SetCreateEmptyFiles(bool bCreateEmptyFiles) -{ - if(bCreateEmptyFiles) - m_iConfigFlags |= eFlag_CreateEmptyFiles; - else - m_iConfigFlags &= ~eFlag_CreateEmptyFiles; -} - -bool TTaskBasicConfiguration::GetCreateOnlyDirectories() const -{ - return m_iConfigFlags & eFlag_CreateOnlyDirectories; -} - -void TTaskBasicConfiguration::SetCreateOnlyDirectories(bool bCreateOnlyDirectories) -{ - if(bCreateOnlyDirectories) - m_iConfigFlags |= eFlag_CreateOnlyDirectories; - else - m_iConfigFlags &= ~eFlag_CreateOnlyDirectories; -} - -//////////////////////////////////////////////////////////////////////////// // CTask members CTask::CTask(chcore::IFeedbackHandler* piFeedbackHandler, size_t stSessionUniqueID) : m_log(), @@ -577,16 +526,6 @@ return m_eCurrentState; } -void CTask::SetTaskBasicConfiguration(const TTaskBasicConfiguration& TTaskBasicConfiguration) -{ - m_tTaskConfig = TTaskBasicConfiguration; -} - -const TTaskBasicConfiguration& CTask::GetTaskBasicConfiguration() const -{ - return m_tTaskConfig; -} - // m_nBufferSize void CTask::SetBufferSizes(const BUFFERSIZES* bsSizes) { @@ -655,7 +594,6 @@ if(bData) { m_tTaskDefinition.Load(ar, bData, 0); - ar >> m_tTaskConfig; m_files.Load(ar, 0, false); @@ -722,7 +660,6 @@ if(bData) { m_tTaskDefinition.Save(ar, bData, 0); - ar << m_tTaskConfig; m_files.Store(ar, 0, false); @@ -964,12 +901,12 @@ _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+7)); // third part - if(m_tTaskConfig.GetIgnoreDirectories()) + if(m_tTaskDefinition.GetConfiguration().GetCopyMoveConfig().GetIgnoreDirectories()) { _tcscat(pData->m_szStatusText, _T("/")); _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+10)); } - if(m_tTaskConfig.GetCreateEmptyFiles()) + if(m_tTaskDefinition.GetConfiguration().GetCopyMoveConfig().GetCreateEmptyFiles()) { _tcscat(pData->m_szStatusText, _T("/")); _tcscat(pData->m_szStatusText, GetResManager().LoadString(IDS_STATUS0_STRING+11)); @@ -1159,8 +1096,8 @@ // enter some data to m_files int iDestDrvNumber = m_tTaskDefinition.GetDestPath().GetDriveNumber(); - bool bIgnoreDirs = m_tTaskConfig.GetIgnoreDirectories(); - bool bForceDirectories = m_tTaskConfig.GetCreateOnlyDirectories(); + bool bIgnoreDirs = m_tTaskDefinition.GetConfiguration().GetCopyMoveConfig().GetIgnoreDirectories(); + bool bForceDirectories = m_tTaskDefinition.GetConfiguration().GetCopyMoveConfig().GetCreateOnlyDirectories(); bool bMove = m_tTaskDefinition.GetOperationType() == eOperation_Move; // add everything @@ -2154,14 +2091,14 @@ // begin at index which wasn't processed previously size_t stSize = m_files.GetSize(); - bool bIgnoreFolders = m_tTaskConfig.GetIgnoreDirectories(); - bool bForceDirectories = m_tTaskConfig.GetCreateOnlyDirectories(); + bool bIgnoreFolders = m_tTaskDefinition.GetConfiguration().GetCopyMoveConfig().GetIgnoreDirectories(); + bool bForceDirectories = m_tTaskDefinition.GetConfiguration().GetCopyMoveConfig().GetCreateOnlyDirectories(); const CDestPath& dpDestPath = m_tTaskDefinition.GetDestPath(); // create a buffer of size m_nBufferSize CUSTOM_COPY_PARAMS ccp; ccp.bProcessed = false; - ccp.bOnlyCreate = m_tTaskConfig.GetCreateEmptyFiles(); + ccp.bOnlyCreate = m_tTaskDefinition.GetConfiguration().GetCopyMoveConfig().GetCreateEmptyFiles(); ccp.dbBuffer.Create(GetBufferSizes()); ccp.pDestPath = &dpDestPath; Index: src/ch/task.h =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -r98791237b8511ff19aa54dc3c6901222287d9914 --- src/ch/task.h (.../task.h) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/task.h (.../task.h) (revision 98791237b8511ff19aa54dc3c6901222287d9914) @@ -243,40 +243,6 @@ mutable boost::shared_mutex m_lock; }; -class TTaskBasicConfiguration -{ -public: - enum EFlags - { - eFlag_None = 0, - eFlag_IgnoreDirectories = 0x0001, - eFlag_CreateEmptyFiles = 0x0002, - eFlag_CreateOnlyDirectories = 0x0004 - }; - -public: - TTaskBasicConfiguration(); - ~TTaskBasicConfiguration(); - - bool GetIgnoreDirectories() const; - void SetIgnoreDirectories(bool bIgnoreDirectories); - - bool GetCreateEmptyFiles() const; - void SetCreateEmptyFiles(bool bCreateEmptyFiles); - - bool GetCreateOnlyDirectories() const; - void SetCreateOnlyDirectories(bool bCreateOnlyDirectories); - - template - void serialize(Archive& ar, unsigned int /*uiVersion*/) - { - ar & m_iConfigFlags; - } - -private: - int m_iConfigFlags; -}; - /////////////////////////////////////////////////////////////////////////// // CTask @@ -305,9 +271,6 @@ void SetTaskState(ETaskCurrentState eTaskState); ETaskCurrentState GetTaskState() const; - void SetTaskBasicConfiguration(const TTaskBasicConfiguration& TTaskBasicConfiguration); - const TTaskBasicConfiguration& GetTaskBasicConfiguration() const; - // m_nBufferSize void SetBufferSizes(const BUFFERSIZES* bsSizes); const BUFFERSIZES* GetBufferSizes(); @@ -438,8 +401,6 @@ // changing fast volatile ETaskCurrentState m_eCurrentState; // current state of processing this task represents - TTaskBasicConfiguration m_tTaskConfig; // task configuration options - TTaskBasicProgressInfo m_TTaskBasicProgressInfo; // task progress information // task control variables (per-session state)