Index: src/ch/ClipboardMonitor.cpp =================================================================== diff -u -r012e8c96dde85616cf4ecbd594afa91517d81a0d -r4d497e3545ae7c7b9fadedcffeb6960cfd19e724 --- src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 012e8c96dde85616cf4ecbd594afa91517d81a0d) +++ src/ch/ClipboardMonitor.cpp (.../ClipboardMonitor.cpp) (revision 4d497e3545ae7c7b9fadedcffeb6960cfd19e724) @@ -69,7 +69,7 @@ // bufor TCHAR path[_MAX_PATH]; - // UINT i; // counter + CTaskPtr spTask; // ptr to a task CClipboardEntryPtr spEntry; Index: src/ch/task.cpp =================================================================== diff -u -r61ed5f2f3084ba759ec27f61b4f909ed8ce305e9 -r4d497e3545ae7c7b9fadedcffeb6960cfd19e724 --- src/ch/task.cpp (.../task.cpp) (revision 61ed5f2f3084ba759ec27f61b4f909ed8ce305e9) +++ src/ch/task.cpp (.../task.cpp) (revision 4d497e3545ae7c7b9fadedcffeb6960cfd19e724) @@ -585,15 +585,15 @@ void CTask::SetTaskState(ETaskCurrentState eTaskState) { - // NOTE: we could check some transition rules here - boost::unique_lock lock(m_lock); - m_eCurrentState = eTaskState; + // NOTE: we could check some transition rules here + boost::unique_lock lock(m_lock); + m_eCurrentState = eTaskState; } ETaskCurrentState CTask::GetTaskState() const { - boost::shared_lock lock(m_lock); - return m_eCurrentState; + boost::shared_lock lock(m_lock); + return m_eCurrentState; } // m_nBufferSize @@ -685,7 +685,7 @@ else { UINT uiData = 0; - int iState = eTaskState_None; + int iState = eTaskState_None; ar >> m_tTaskProgressInfo; @@ -694,19 +694,19 @@ ar >> uiData; m_nStatus = uiData; - // load task state, convert "waiting" state to "processing" - ar >> iState; - if(iState >= eTaskState_None && iState < eTaskState_Max) - { - if(iState == eTaskState_Waiting) - iState = eTaskState_Processing; - m_eCurrentState = (ETaskCurrentState)iState; - } - else - { - BOOST_ASSERT(false); - THROW(_T("Wrong data read from stream"), 0, 0, 0); - } + // load task state, convert "waiting" state to "processing" + ar >> iState; + if(iState >= eTaskState_None && iState < eTaskState_Max) + { + if(iState == eTaskState_Waiting) + iState = eTaskState_Processing; + m_eCurrentState = (ETaskCurrentState)iState; + } + else + { + BOOST_ASSERT(false); + THROW(_T("Wrong data read from stream"), 0, 0, 0); + } ar >> m_bsSizes; ar >> m_nPriority; @@ -765,12 +765,12 @@ UINT uiStatus = (m_nStatus & ST_WRITE_MASK); ar << uiStatus; - // store current state (convert from waiting to processing state before storing) - int iState = m_eCurrentState; - if(iState == eTaskState_Waiting) - iState = eTaskState_Processing; + // store current state (convert from waiting to processing state before storing) + int iState = m_eCurrentState; + if(iState == eTaskState_Waiting) + iState = eTaskState_Processing; - ar << iState; + ar << iState; ar << m_bsSizes; ar << m_nPriority; @@ -829,9 +829,9 @@ { KillThread(); - SetTaskState(eTaskState_None); + SetTaskState(eTaskState_None); - m_localStats.SetTimeElapsed(0); + m_localStats.SetTimeElapsed(0); m_tTaskProgressInfo.SetCurrentIndex(0); BeginProcessing(); @@ -878,8 +878,7 @@ } } - pData->m_uiStatus = m_nStatus; - pData->m_eTaskState = m_eCurrentState; + pData->m_eTaskState = m_eCurrentState; // percents pData->m_nPercent = m_localStats.GetProgressInPercent(); @@ -921,8 +920,7 @@ pData->m_nPriority=m_nPriority; pData->m_pdpDestPath=&m_dpDestPath; pData->m_pafFilters=&m_afFilters; - pData->m_uiStatus=m_nStatus; - pData->m_eTaskState = m_eCurrentState; + pData->m_eTaskState = m_eCurrentState; pData->m_stIndex = stCurrentIndex; pData->m_ullProcessedSize = m_localStats.GetProcessedSize(); pData->m_stSize=m_files.GetSize(); @@ -939,41 +937,41 @@ // status string // first - switch(m_eCurrentState) - { - case eTaskState_Error: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+4, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - case eTaskState_Paused: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+5, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - case eTaskState_Finished: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+3, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - case eTaskState_Waiting: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+9, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - case eTaskState_Cancelled: - { - GetResManager().LoadStringCopy(IDS_STATUS0_STRING+8, pData->m_szStatusText, _MAX_PATH); - _tcscat(pData->m_szStatusText, _T("/")); - break; - } - default: - _tcscpy(pData->m_szStatusText, _T("")); - } + switch(m_eCurrentState) + { + case eTaskState_Error: + { + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+4, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + break; + } + case eTaskState_Paused: + { + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+5, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + break; + } + case eTaskState_Finished: + { + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+3, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + break; + } + case eTaskState_Waiting: + { + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+9, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + break; + } + case eTaskState_Cancelled: + { + GetResManager().LoadStringCopy(IDS_STATUS0_STRING+8, pData->m_szStatusText, _MAX_PATH); + _tcscat(pData->m_szStatusText, _T("/")); + break; + } + default: + _tcscpy(pData->m_szStatusText, _T("")); + } // second part if( (m_nStatus & ST_STEP_MASK) == ST_DELETING ) @@ -1977,7 +1975,7 @@ unsigned long ulRead = 0; unsigned long ulWritten = 0; int iBufferIndex = 0; - bool bLastPart = false; + bool bLastPart = false; do { @@ -2036,8 +2034,8 @@ if(ulRead > 0) { - // determine if this is the last chunk of data we could get from the source file (EOF condition) - bLastPart = (ulToRead != ulRead); + // determine if this is the last chunk of data we could get from the source file (EOF condition) + bLastPart = (ulToRead != ulRead); // handle not aligned part at the end of file when no buffering is enabled if(bNoBuffer && bLastPart) @@ -2500,14 +2498,14 @@ case E_PAUSE: SetTaskState(eTaskState_Paused); break; - case E_KILL_REQUEST: - { - // the only operation - if(GetTaskState() == eTaskState_Waiting) - SetTaskState(eTaskState_Processing); - } - default: - BOOST_ASSERT(false); // unhandled case + case E_KILL_REQUEST: + { + // the only operation + if(GetTaskState() == eTaskState_Waiting) + SetTaskState(eTaskState_Processing); + } + default: + BOOST_ASSERT(false); // unhandled case } // change flags and calls cleanup for a task Index: src/ch/task.h =================================================================== diff -u -r61ed5f2f3084ba759ec27f61b4f909ed8ce305e9 -r4d497e3545ae7c7b9fadedcffeb6960cfd19e724 --- src/ch/task.h (.../task.h) (revision 61ed5f2f3084ba759ec27f61b4f909ed8ce305e9) +++ src/ch/task.h (.../task.h) (revision 4d497e3545ae7c7b9fadedcffeb6960cfd19e724) @@ -53,16 +53,16 @@ enum ETaskCurrentState { - eTaskState_None, - eTaskState_Waiting, - eTaskState_Processing, - eTaskState_Paused, - eTaskState_Cancelled, - eTaskState_Error, - eTaskState_Finished, + eTaskState_None, + eTaskState_Waiting, + eTaskState_Processing, + eTaskState_Paused, + eTaskState_Cancelled, + eTaskState_Error, + eTaskState_Finished, - // insert new values before this one - eTaskState_Max + // insert new values before this one + eTaskState_Max }; /////////////////////////////////////////////////////////////////////////// @@ -89,17 +89,16 @@ CDestPath* m_pdpDestPath; CFiltersArray* m_pafFilters; - UINT m_uiStatus; - ETaskCurrentState m_eTaskState; + ETaskCurrentState m_eTaskState; const BUFFERSIZES* m_pbsSizes; - int m_nPriority; + int m_nPriority; - ull_t m_ullProcessedSize; - ull_t m_ullSizeAll; - int m_nPercent; + ull_t m_ullProcessedSize; + ull_t m_ullSizeAll; + int m_nPercent; - time_t m_timeElapsed; + time_t m_timeElapsed; const CString* m_pstrUniqueName; // doesn't change from first setting @@ -110,8 +109,7 @@ { CString m_strPath; - UINT m_uiStatus; - ETaskCurrentState m_eTaskState; + ETaskCurrentState m_eTaskState; int m_nPercent; }; @@ -393,8 +391,8 @@ void SetStatus(UINT nStatus, UINT nMask); UINT GetStatus(UINT nMask = 0xffffffff); - void SetTaskState(ETaskCurrentState eTaskState); - ETaskCurrentState GetTaskState() const; + void SetTaskState(ETaskCurrentState eTaskState); + ETaskCurrentState GetTaskState() const; // m_nBufferSize void SetBufferSizes(const BUFFERSIZES* bsSizes); @@ -531,7 +529,7 @@ CFileInfoArray m_files; // list of files/directories found during operating on the task input data (filled by search for files) // changing fast - volatile ETaskCurrentState m_eCurrentState; // current state of processing this task represents + volatile ETaskCurrentState m_eCurrentState; // current state of processing this task represents volatile UINT m_nStatus; // what phase of the operation is this task in TTaskProgressInfo m_tTaskProgressInfo; // task progress information