Index: src/ch/task.cpp =================================================================== diff -u -N -r591f291e22d2ece89acb266c8aa0b05c257a407c -rc54aa186fda8c0af84325325276245e9d8fcfa26 --- src/ch/task.cpp (.../task.cpp) (revision 591f291e22d2ece89acb266c8aa0b05c257a407c) +++ src/ch/task.cpp (.../task.cpp) (revision c54aa186fda8c0af84325325276245e9d8fcfa26) @@ -590,8 +590,10 @@ m_tTaskDefinition.Load(strPath); m_strFilePath = strPath; + // 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()); + m_afFilters.ReadFromConfig(m_tTaskDefinition.GetConfiguration(), TASK_PROP_NAME_FILTERING); //////////////////////////////// // now rarely changing task progress data @@ -604,8 +606,6 @@ CalculateTotalSizeNL(); - ar >> m_afFilters; - /////////////////////////////////// // and often changing data CString strOftenChangingPath = GetRelatedPathNL(ePathType_TaskOftenChangingState); @@ -665,8 +665,6 @@ m_arrSourcePathsInfo.Store(ar, 0, true); m_files.Store(ar, 0, false); - - ar << m_afFilters; } if(m_bOftenStateModified) @@ -829,7 +827,7 @@ pData->m_nPriority = GetTaskPropValue(m_tTaskDefinition.GetConfiguration()); pData->m_pathDstPath = m_tTaskDefinition.GetDestinationPath(); - pData->m_pafFilters=&m_afFilters; + pData->m_pafFilters = &m_afFilters; pData->m_eTaskState = m_eCurrentState; pData->m_stIndex = stCurrentIndex; pData->m_ullProcessedSize = m_localStats.GetProcessedSize(); @@ -897,16 +895,6 @@ } } -void CTask::SetFilters(const CFiltersArray* pFilters) -{ - BOOST_ASSERT(pFilters); - if(!pFilters) - THROW(_T("Invalid argument"), 0, 0, 0); - - boost::unique_lock lock(m_lock); - m_afFilters = *pFilters; -} - bool CTask::CanBegin() { bool bRet=true; @@ -1045,6 +1033,9 @@ // delete the content of m_files m_files.Clear(); + // read filtering options + m_afFilters.ReadFromConfig(m_tTaskDefinition.GetConfiguration(), TASK_PROP_NAME_FILTERING); + // enter some data to m_files int iDestDrvNumber = 0; GetDriveData(m_tTaskDefinition.GetDestinationPath(), &iDestDrvNumber, NULL);