Index: src/ch/CfgProperties.cpp =================================================================== diff -u -r583756058945ab95a48e17b31455b0ed4b213b8e -r4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5 --- src/ch/CfgProperties.cpp (.../CfgProperties.cpp) (revision 583756058945ab95a48e17b31455b0ed4b213b8e) +++ src/ch/CfgProperties.cpp (.../CfgProperties.cpp) (revision 4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5) @@ -69,8 +69,6 @@ pManager->register_signed_num(_t("Copying/Show visual feedback"), 2, 0, 2); pManager->register_bool(_t("Copying/Use timed feedback dialogs"), false); pManager->register_signed_num(_t("Copying/Feedback time"), 60*llSecond, 0, 24*llHour); - pManager->register_bool(_t("Copying/Auto retry on error"), true); - pManager->register_signed_num(_t("Copying/Auto retry interval"), 10*llSecond, 0, 24*llHour); pManager->register_signed_num(_t("Copying/Default priority"), THREAD_PRIORITY_NORMAL, 0, 0xffffffff); pManager->register_bool(_t("Copying/Disable priority boost"), false); pManager->register_bool(_t("Copying/Delete files after finished"), true); Index: src/ch/CfgProperties.h =================================================================== diff -u -r583756058945ab95a48e17b31455b0ed4b213b8e -r4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5 --- src/ch/CfgProperties.h (.../CfgProperties.h) (revision 583756058945ab95a48e17b31455b0ed4b213b8e) +++ src/ch/CfgProperties.h (.../CfgProperties.h) (revision 4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5) @@ -64,8 +64,7 @@ PP_CMSHOWVISUALFEEDBACK, PP_CMUSETIMEDFEEDBACK, PP_CMFEEDBACKTIME, - PP_CMAUTORETRYONERROR, - PP_CMAUTORETRYINTERVAL, + PP_CMDEFAULTPRIORITY, PP_CMDISABLEPRIORITYBOOST, PP_CMDELETEAFTERFINISHED, Index: src/ch/FileInfo.cpp =================================================================== diff -u -rbd08c279240bac9e7902f8da6a9251e0252ec324 -r4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5 --- src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision bd08c279240bac9e7902f8da6a9251e0252ec324) +++ src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision 4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5) @@ -483,7 +483,7 @@ m_pClipboard->GetAt(m_stSrcIndex)->SetDestinationPath(strNewPath); } - CString strResultPath = strPath+m_pClipboard->GetAt(m_stSrcIndex)->GetDestinationPath(ucCopyNumber)+m_strFilePath; + CString strResultPath = strPath+m_pClipboard->GetAt(m_stSrcIndex)->GetDestinationPath()+m_strFilePath; return strResultPath; } else Index: src/ch/MainWnd.cpp =================================================================== diff -u -rbd08c279240bac9e7902f8da6a9251e0252ec324 -r4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision bd08c279240bac9e7902f8da6a9251e0252ec324) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5) @@ -50,7 +50,6 @@ #define WM_IDENTIFY WM_USER+11 #define TM_AUTOREMOVE 1000 -#define TM_AUTORESUME 1000 #define TM_ACCEPTING 100 extern CSharedConfigStruct* g_pscsShared; @@ -240,7 +239,6 @@ // start saving timer SetTimer(1023, (UINT)GetConfig().get_signed_num(PP_PAUTOSAVEINTERVAL), NULL); - SetTimer(7834, TM_AUTORESUME, NULL); SetTimer(3245, TM_AUTOREMOVE, NULL); SetTimer(8743, TM_ACCEPTING, NULL); // ends wait state in tasks @@ -370,22 +368,6 @@ m_tasks.SaveProgress(); SetTimer(1023, (UINT)GetConfig().get_signed_num(PP_PAUTOSAVEINTERVAL), NULL); break; - case 7834: - { - // auto-resume timer - KillTimer(7834); - DWORD dwTime=GetTickCount(); - DWORD dwInterval=(m_dwLastTime == 0) ? TM_AUTORESUME : dwTime-m_dwLastTime; - m_dwLastTime=dwTime; - - if (GetConfig().get_bool(PP_CMAUTORETRYONERROR)) - { - if (m_tasks.TasksRetryProcessing(true, dwInterval) && m_pdlgStatus && m_pdlgStatus->m_bLock && IsWindow(m_pdlgStatus->m_hWnd)) - m_pdlgStatus->SendMessage(WM_UPDATESTATUS); - } - SetTimer(7834, TM_AUTORESUME, NULL); - } - break; case 3245: // auto-delete finished tasks timer KillTimer(3245); Index: src/ch/OptionsDlg.cpp =================================================================== diff -u -rc435ab507c8b8280264188b49e9ada56d46c0261 -r4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5 --- src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision c435ab507c8b8280264188b49e9ada56d46c0261) +++ src/ch/OptionsDlg.cpp (.../OptionsDlg.cpp) (revision 4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5) @@ -304,8 +304,6 @@ PROP_COMBO(IDS_SHOWVISUALFEEDBACK_STRING, IDS_FEEDBACKTYPE_STRING, GetConfig().get_signed_num(PP_CMSHOWVISUALFEEDBACK)); PROP_BOOL(IDS_USETIMEDDIALOGS_STRING, GetConfig().get_bool(PP_CMUSETIMEDFEEDBACK)); PROP_UINT(IDS_TIMEDDIALOGINTERVAL_STRING, GetConfig().get_signed_num(PP_CMFEEDBACKTIME)); - PROP_BOOL(IDS_AUTORETRYONERROR_STRING, GetConfig().get_bool(PP_CMAUTORETRYONERROR)); - PROP_UINT(IDS_AUTORETRYINTERVAL_STRING, GetConfig().get_signed_num(PP_CMAUTORETRYINTERVAL)); PROP_COMBO(IDS_DEFAULTPRIORITY_STRING, MakeCompoundString(IDS_PRIORITY0_STRING, 7, _T("!")), PriorityToIndex(boost::numeric_cast(GetConfig().get_signed_num(PP_CMDEFAULTPRIORITY)))); PROP_BOOL(IDS_CFGDISABLEPRIORITYBOOST_STRING, GetConfig().get_bool(PP_CMDISABLEPRIORITYBOOST)); PROP_BOOL(IDS_DELETEAFTERFINISHED_STRING, GetConfig().get_bool(PP_CMDELETEAFTERFINISHED)); @@ -418,8 +416,6 @@ rConfig.set_signed_num(PP_CMSHOWVISUALFEEDBACK, GetIndexProp(iPosition++)); rConfig.set_bool(PP_CMUSETIMEDFEEDBACK, GetBoolProp(iPosition++)); rConfig.set_signed_num(PP_CMFEEDBACKTIME, GetUintProp(iPosition++)); - rConfig.set_bool(PP_CMAUTORETRYONERROR, GetBoolProp(iPosition++)); - rConfig.set_signed_num(PP_CMAUTORETRYINTERVAL, GetUintProp(iPosition++)); rConfig.set_signed_num(PP_CMDEFAULTPRIORITY, IndexToPriority(GetIndexProp(iPosition++))); rConfig.set_bool(PP_CMDISABLEPRIORITYBOOST, GetBoolProp(iPosition++)); rConfig.set_bool(PP_CMDELETEAFTERFINISHED, GetBoolProp(iPosition++)); Index: src/ch/resource.h =================================================================== diff -u -rbd08c279240bac9e7902f8da6a9251e0252ec324 -r4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5 --- src/ch/resource.h (.../resource.h) (revision bd08c279240bac9e7902f8da6a9251e0252ec324) +++ src/ch/resource.h (.../resource.h) (revision 4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5) @@ -351,8 +351,6 @@ #define IDS_SHOWVISUALFEEDBACK_STRING 8023 #define IDS_USETIMEDDIALOGS_STRING 8024 #define IDS_TIMEDDIALOGINTERVAL_STRING 8025 -#define IDS_AUTORETRYONERROR_STRING 8026 -#define IDS_AUTORETRYINTERVAL_STRING 8027 #define IDS_DEFAULTPRIORITY_STRING 8028 #define IDS_AUTODETECTBUFFERSIZE_STRING 8029 #define IDS_DEFAULTBUFFERSIZE_STRING 8030 Index: src/ch/task.cpp =================================================================== diff -u -rbd08c279240bac9e7902f8da6a9251e0252ec324 -r4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5 --- src/ch/task.cpp (.../task.cpp) (revision bd08c279240bac9e7902f8da6a9251e0252ec324) +++ src/ch/task.cpp (.../task.cpp) (revision 4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5) @@ -389,7 +389,6 @@ m_stCurrentIndex(0), m_nStatus(ST_NULL_STATUS), m_nPriority(THREAD_PRIORITY_NORMAL), - m_uiResumeInterval(0), m_bForce(false), m_bContinue(false), m_bSaved(false), @@ -795,7 +794,6 @@ { boost::unique_lock lock(m_lock); - m_uiResumeInterval = 0; // just in case m_bSaved = false; // save m_workerThread.StartThread(ThrdProc, this, m_nPriority); @@ -812,21 +810,11 @@ } } -bool CTask::RetryProcessing(bool bOnlyErrors, UINT uiInterval) +bool CTask::RetryProcessing() { // retry used to auto-resume, after loading - if( (GetStatus(ST_WORKING_MASK) == ST_ERROR || (!bOnlyErrors && GetStatus(ST_WORKING_MASK) != ST_PAUSED)) - && GetStatus(ST_STEP_MASK) != ST_FINISHED && GetStatus(ST_STEP_MASK) != ST_CANCELLED) + if(GetStatus(ST_WORKING_MASK) != ST_PAUSED && GetStatus(ST_STEP_MASK) != ST_FINISHED && GetStatus(ST_STEP_MASK) != ST_CANCELLED) { - if(uiInterval != 0) - { - m_uiResumeInterval+=uiInterval; - if(m_uiResumeInterval < (UINT)GetConfig().get_signed_num(PP_CMAUTORETRYINTERVAL)) - return false; - else - m_uiResumeInterval=0; - } - SetStatus(0, ST_ERROR); BeginProcessing(); return true; @@ -3070,13 +3058,13 @@ } } -bool CTaskArray::TasksRetryProcessing(bool bOnlyErrors, UINT uiInterval) +bool CTaskArray::TasksRetryProcessing() { boost::shared_lock lock(m_lock); bool bChanged=false; BOOST_FOREACH(CTaskPtr& spTask, m_vTasks) { - if(spTask->RetryProcessing(bOnlyErrors, uiInterval)) + if(spTask->RetryProcessing()) bChanged = true; } @@ -3122,7 +3110,7 @@ uiStatus = spTask->GetStatus(); bFlag = ((uiStatus & ST_STEP_MASK) == ST_FINISHED || (uiStatus & ST_STEP_MASK) == ST_CANCELLED || (uiStatus & ST_WORKING_MASK) == ST_PAUSED - || ((uiStatus & ST_WORKING_MASK) == ST_ERROR && !GetConfig().get_bool(PP_CMAUTORETRYONERROR))); + || ((uiStatus & ST_WORKING_MASK) == ST_ERROR)); if(!bFlag) break; Index: src/ch/task.h =================================================================== diff -u -rbd08c279240bac9e7902f8da6a9251e0252ec324 -r4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5 --- src/ch/task.h (.../task.h) (revision bd08c279240bac9e7902f8da6a9251e0252ec324) +++ src/ch/task.h (.../task.h) (revision 4ec3aef62d14193e3021e6bc3f8bcdf11770c7d5) @@ -345,7 +345,7 @@ void PauseProcessing(); // pause void ResumeProcessing(); // resume - bool RetryProcessing(bool bOnlyErrors=false, UINT uiInterval=0); // retry + bool RetryProcessing(); // retry void RestartProcessing(); // from beginning void CancelProcessing(); // cancel @@ -452,47 +452,45 @@ void RequestStopThread(); private: - icpf::log_file m_log; - mutable boost::shared_mutex m_lock; // protection for this class + // task initial information (needed to start a task); might be a bit processed. + CClipboardArray m_clipboard; // original paths with which we started operation + CDestPath m_dpDestPath; // destination path - UINT m_uiResumeInterval; // works only if the thread is off + // task settings + int m_nPriority; // task priority (really processing thread priority) - // feedback - chcore::IFeedbackHandler* m_piFeedbackHandler; + CString m_strUniqueName; // name for the task (should be something like uuid) + CFiltersArray m_afFilters; // filtering settings for files (will be filtered according to the rules inside when searching for files) - // ptr to count of currently started tasks - bool m_bForce; // if the continuation of tasks should be independent of limitation - bool m_bContinue; // used by ClipboardMonitorProc + BUFFERSIZES m_bsSizes; // sizes of buffers used to copy (derived from the global - CClipboardArray m_clipboard; - CFileInfoArray m_files; + // current task state (derivatives of the task initial information) + // changing slowly or only partially + CFileInfoArray m_files; // list of files/directories found during operating on the task input data (filled by search for files) - volatile size_t m_stCurrentIndex; + // changing fast + volatile UINT m_nStatus; // what phase of the operation is this task in + volatile size_t m_stCurrentIndex; // index to the m_files array stating currently processed item - CDestPath m_dpDestPath; + // task control variables (per-session state) + TTaskLocalStats m_localStats; // local statistics - volatile UINT m_nStatus; + bool m_bForce; // if the continuation of tasks should be independent of limitation + bool m_bContinue; // used by ClipboardMonitorProc - // buffers - BUFFERSIZES m_bsSizes; + tstring_t m_strTaskBasePath; // base path at which the files will be stored + bool m_bSaved; // has the state been saved ('til next modification) - TWorkerThreadController m_workerThread; + size_t m_stSessionUniqueID; - int m_nPriority; + // other helpers + icpf::log_file m_log; + TWorkerThreadController m_workerThread; - // other stuff - CString m_strUniqueName; + mutable boost::shared_mutex m_lock; // protection for this class - // mask (filter) - CFiltersArray m_afFilters; + chcore::IFeedbackHandler* m_piFeedbackHandler; // feedback - tstring_t m_strTaskBasePath; // base path at which the files will be stored - bool m_bSaved; // has the state been saved ('til next modification) - - size_t m_stSessionUniqueID; - - TTaskLocalStats m_localStats; - friend class CTaskArray; }; @@ -552,7 +550,7 @@ void TasksPauseProcessing(); void TasksResumeProcessing(); void TasksRestartProcessing(); - bool TasksRetryProcessing(bool bOnlyErrors=false, UINT uiInterval=0); + bool TasksRetryProcessing(); void TasksCancelProcessing(); ull_t GetPosition();