Index: src/ch/CustomCopyDlg.cpp =================================================================== diff -u -rde5a63babb2991c808333230014a4f2e6cc8b7b2 -r10d4c73f3589c377ec0b60a2a053ff6aafeb507f --- src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision de5a63babb2991c808333230014a4f2e6cc8b7b2) +++ src/ch/CustomCopyDlg.cpp (.../CustomCopyDlg.cpp) (revision 10d4c73f3589c377ec0b60a2a053ff6aafeb507f) @@ -600,16 +600,16 @@ BOOST_ASSERT(pFilter); if(pFilter) { - if(pFilter->m_bUseMask) + if(pFilter->GetUseMask()) dlg.m_astrAddMask.Add(pFilter->GetCombinedMask(strData)); - if(pFilter->m_bUseExcludeMask) + if(pFilter->GetUseExcludeMask()) dlg.m_astrAddExcludeMask.Add(pFilter->GetCombinedExcludeMask(strData)); } } if(dlg.DoModal() == IDOK) { - if(dlg.m_ffFilter.m_bUseMask || dlg.m_ffFilter.m_bUseExcludeMask || dlg.m_ffFilter.m_bUseSize || dlg.m_ffFilter.m_bUseDate || dlg.m_ffFilter.m_bUseAttributes) + if(dlg.m_ffFilter.GetUseMask() || dlg.m_ffFilter.GetUseExcludeMask() || dlg.m_ffFilter.GetUseSize1() || dlg.m_ffFilter.GetUseDateTime1() || dlg.m_ffFilter.GetUseAttributes()) { afFilters.Add(dlg.m_ffFilter); SetTaskPropValue(m_tTaskDefinition.GetConfiguration(), afFilters); @@ -632,7 +632,7 @@ ///////////////////// lvi.iSubItem=0; - if (rFilter.m_bUseMask) + if (rFilter.GetUseMask()) { chcore::TString strData; rFilter.GetCombinedMask(strData); @@ -648,7 +648,7 @@ ///////////////////// lvi.iSubItem=1; - if (rFilter.m_bUseExcludeMask) + if (rFilter.GetUseExcludeMask()) { chcore::TString strData; rFilter.GetCombinedExcludeMask(strData); @@ -664,15 +664,15 @@ ///////////////// lvi.iSubItem=2; - if (rFilter.m_bUseSize) + if (rFilter.GetUseSize1()) { - _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager().LoadString(IDS_LT_STRING+rFilter.m_iSizeType1), GetSizeString(rFilter.m_ullSize1, szData, 64, true)); + _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager().LoadString(IDS_LT_STRING+rFilter.GetSizeType1()), GetSizeString(rFilter.GetSize1(), szData, 64, true)); szLoaded[1023] = _T('\0'); - if (rFilter.m_bUseSize2) + if (rFilter.GetUseSize2()) { _tcscat(szLoaded, GetResManager().LoadString(IDS_AND_STRING)); CString strLoaded2; - strLoaded2.Format(_T("%s %s"), GetResManager().LoadString(IDS_LT_STRING+rFilter.m_iSizeType2), GetSizeString(rFilter.m_ullSize2, szData, 64, true)); + strLoaded2.Format(_T("%s %s"), GetResManager().LoadString(IDS_LT_STRING+rFilter.GetSizeType2()), GetSizeString(rFilter.GetSize2(), szData, 64, true)); _tcscat(szLoaded, strLoaded2); } } @@ -686,23 +686,23 @@ /////////////////// lvi.iSubItem=3; - if (rFilter.m_bUseDate) + if (rFilter.GetUseDateTime1()) { - _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager().LoadString(IDS_DATECREATED_STRING+rFilter.m_iDateType), GetResManager().LoadString(IDS_LT_STRING+rFilter.m_iDateType1)); + _sntprintf(szLoaded, 1024, _T("%s %s"), GetResManager().LoadString(IDS_DATECREATED_STRING+rFilter.GetDateType()), GetResManager().LoadString(IDS_LT_STRING+rFilter.GetDateCmpType1())); szLoaded[1023] = _T('\0'); - if (rFilter.m_bDate1) - _tcscat(szLoaded, rFilter.m_tDate1.Format(_T(" %x"))); - if (rFilter.m_bTime1) - _tcscat(szLoaded, rFilter.m_tTime1.Format(_T(" %X"))); + if (rFilter.GetUseDate1()) + _tcscat(szLoaded, rFilter.GetDate1().Format(_T(" %x"))); + if (rFilter.GetUseTime1()) + _tcscat(szLoaded, rFilter.GetTime1().Format(_T(" %X"))); - if (rFilter.m_bUseDate2) + if (rFilter.GetUseDateTime2()) { _tcscat(szLoaded, GetResManager().LoadString(IDS_AND_STRING)); - _tcscat(szLoaded, GetResManager().LoadString(IDS_LT_STRING+rFilter.m_iDateType2)); - if (rFilter.m_bDate2) - _tcscat(szLoaded, rFilter.m_tDate2.Format(_T(" %x"))); - if (rFilter.m_bTime2) - _tcscat(szLoaded, rFilter.m_tTime2.Format(_T(" %X"))); + _tcscat(szLoaded, GetResManager().LoadString(IDS_LT_STRING+rFilter.GetDateCmpType2())); + if (rFilter.GetUseDate2()) + _tcscat(szLoaded, rFilter.GetDate2().Format(_T(" %x"))); + if (rFilter.GetUseTime2()) + _tcscat(szLoaded, rFilter.GetTime2().Format(_T(" %X"))); } } else @@ -715,21 +715,21 @@ ///////////////////// lvi.iSubItem=4; szLoaded[0]=_T('\0'); - if (rFilter.m_bUseAttributes) + if(rFilter.GetUseAttributes()) { - if (rFilter.m_iArchive == 1) + if(rFilter.GetArchive() == 1) _tcscat(szLoaded, _T("A")); - if (rFilter.m_iReadOnly == 1) + if(rFilter.GetReadOnly() == 1) _tcscat(szLoaded, _T("R")); - if (rFilter.m_iHidden == 1) + if(rFilter.GetHidden() == 1) _tcscat(szLoaded, _T("H")); - if (rFilter.m_iSystem == 1) + if(rFilter.GetSystem() == 1) _tcscat(szLoaded, _T("S")); - if (rFilter.m_iDirectory == 1) + if(rFilter.GetDirectory() == 1) _tcscat(szLoaded, _T("D")); } - if (!rFilter.m_bUseAttributes || szLoaded[0] == _T('\0')) + if (!rFilter.GetUseAttributes() || szLoaded[0] == _T('\0')) _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERATTRIB_STRING)); lvi.pszText=szLoaded; @@ -739,21 +739,21 @@ ///////////////////// lvi.iSubItem=5; szLoaded[0]=_T('\0'); - if (rFilter.m_bUseAttributes) + if(rFilter.GetUseAttributes()) { - if (rFilter.m_iArchive == 0) + if(rFilter.GetArchive() == 0) _tcscat(szLoaded, _T("A")); - if (rFilter.m_iReadOnly == 0) + if(rFilter.GetReadOnly() == 0) _tcscat(szLoaded, _T("R")); - if (rFilter.m_iHidden == 0) + if(rFilter.GetHidden() == 0) _tcscat(szLoaded, _T("H")); - if (rFilter.m_iSystem == 0) + if(rFilter.GetSystem() == 0) _tcscat(szLoaded, _T("S")); - if (rFilter.m_iDirectory == 0) + if(rFilter.GetDirectory() == 0) _tcscat(szLoaded, _T("D")); } - if (!rFilter.m_bUseAttributes || szLoaded[0] == _T('0')) + if(!rFilter.GetUseAttributes() || szLoaded[0] == _T('0')) _tcscpy(szLoaded, GetResManager().LoadString(IDS_FILTERATTRIB_STRING)); lvi.pszText=szLoaded; @@ -840,9 +840,9 @@ BOOST_ASSERT(pFilter); if(pFilter) { - if(pFilter->m_bUseMask && boost::numeric_cast(stIndex) != iItem) + if(pFilter->GetUseMask() && boost::numeric_cast(stIndex) != iItem) dlg.m_astrAddMask.Add(pFilter->GetCombinedMask(strData)); - if (pFilter->m_bUseExcludeMask && boost::numeric_cast(stIndex) != iItem) + if (pFilter->GetUseExcludeMask() && boost::numeric_cast(stIndex) != iItem) dlg.m_astrAddExcludeMask.Add(pFilter->GetCombinedExcludeMask(strData)); } } @@ -854,8 +854,8 @@ //m_ccData.m_afFilters.RemoveAt(iItem); // insert new if needed - if (dlg.m_ffFilter.m_bUseMask || dlg.m_ffFilter.m_bUseExcludeMask || dlg.m_ffFilter.m_bUseSize - || dlg.m_ffFilter.m_bUseDate || dlg.m_ffFilter.m_bUseAttributes) + if (dlg.m_ffFilter.GetUseMask() || dlg.m_ffFilter.GetUseExcludeMask() || dlg.m_ffFilter.GetUseSize1() + || dlg.m_ffFilter.GetUseDateTime1() || dlg.m_ffFilter.GetUseAttributes()) { afFilters.SetAt(iItem, dlg.m_ffFilter); SetTaskPropValue(m_tTaskDefinition.GetConfiguration(), afFilters); Index: src/ch/FileFilter.cpp =================================================================== diff -u -rde5a63babb2991c808333230014a4f2e6cc8b7b2 -r10d4c73f3589c377ec0b60a2a053ff6aafeb507f --- src/ch/FileFilter.cpp (.../FileFilter.cpp) (revision de5a63babb2991c808333230014a4f2e6cc8b7b2) +++ src/ch/FileFilter.cpp (.../FileFilter.cpp) (revision 10d4c73f3589c377ec0b60a2a053ff6aafeb507f) @@ -40,27 +40,27 @@ m_astrExcludeMask.Clear(); // size filtering - m_bUseSize=false; - m_iSizeType1=GT; + m_bUseSize1=false; + m_eSizeCmpType1=eSizeCmp_Greater; m_ullSize1=0; m_bUseSize2=false; - m_iSizeType2=LT; + m_eSizeCmpType2=eSizeCmp_Less; m_ullSize2=0; // date filtering - m_bUseDate=false; - m_iDateType=DATE_CREATED; - m_iDateType1=GT; - m_bDate1=false; + m_bUseDateTime1=false; + m_eDateType = eDateType_Created; + m_eDateCmpType1 = eDateCmp_Greater; + m_bUseDate1=false; m_tDate1=CTime::GetCurrentTime(); - m_bTime1=false; + m_bUseTime1=false; m_tTime1=CTime::GetCurrentTime(); + m_bUseDateTime2=false; + m_eDateCmpType2 = eDateCmp_Less; m_bUseDate2=false; - m_iDateType2=LT; - m_bDate2=false; m_tDate2=CTime::GetCurrentTime(); - m_bTime2=false; + m_bUseTime2=false; m_tTime2=CTime::GetCurrentTime(); // attribute filtering @@ -87,27 +87,27 @@ m_astrExcludeMask = rFilter.m_astrExcludeMask; // size filtering - m_bUseSize=rFilter.m_bUseSize; - m_iSizeType1=rFilter.m_iSizeType1; + m_bUseSize1=rFilter.m_bUseSize1; + m_eSizeCmpType1=rFilter.m_eSizeCmpType1; m_ullSize1=rFilter.m_ullSize1; m_bUseSize2=rFilter.m_bUseSize2; - m_iSizeType2=rFilter.m_iSizeType2; + m_eSizeCmpType2=rFilter.m_eSizeCmpType2; m_ullSize2=rFilter.m_ullSize2; // date filtering - m_bUseDate=rFilter.m_bUseDate; - m_iDateType=rFilter.m_iDateType; - m_iDateType1=rFilter.m_iDateType1; - m_bDate1=rFilter.m_bDate1; + m_bUseDateTime1=rFilter.m_bUseDateTime1; + m_eDateType=rFilter.m_eDateType; + m_eDateCmpType1=rFilter.m_eDateCmpType1; + m_bUseDate1=rFilter.m_bUseDate1; m_tDate1=rFilter.m_tDate1; - m_bTime1=rFilter.m_bTime1; + m_bUseTime1=rFilter.m_bUseTime1; m_tTime1=rFilter.m_tTime1; + m_bUseDateTime2=rFilter.m_bUseDateTime2; + m_eDateCmpType2=rFilter.m_eDateCmpType2; m_bUseDate2=rFilter.m_bUseDate2; - m_iDateType2=rFilter.m_iDateType2; - m_bDate2=rFilter.m_bDate2; m_tDate2=rFilter.m_tDate2; - m_bTime2=rFilter.m_bTime2; + m_bUseTime2=rFilter.m_bUseTime2; m_tTime2=rFilter.m_tTime2; // attribute filtering @@ -201,26 +201,26 @@ SetConfigValue(rConfig, _T("ExcludeMask.Use"), m_bUseExcludeMask); SetConfigValue(rConfig, _T("ExcludeMask.MaskList.Mask"), m_astrExcludeMask); - SetConfigValue(rConfig, _T("SizeA.Use"), m_bUseSize); - SetConfigValue(rConfig, _T("SizeA.FilteringType"), m_iSizeType1); + SetConfigValue(rConfig, _T("SizeA.Use"), m_bUseSize1); + SetConfigValue(rConfig, _T("SizeA.FilteringType"), m_eSizeCmpType1); SetConfigValue(rConfig, _T("SizeA.Value"), m_ullSize1); SetConfigValue(rConfig, _T("SizeB.Use"), m_bUseSize2); - SetConfigValue(rConfig, _T("SizeB.FilteringType"), m_iSizeType2); + SetConfigValue(rConfig, _T("SizeB.FilteringType"), m_eSizeCmpType2); SetConfigValue(rConfig, _T("SizeB.Value"), m_ullSize2); - SetConfigValue(rConfig, _T("DateA.Use"), m_bUseDate); - SetConfigValue(rConfig, _T("DateA.Type"), m_iDateType); // created/last modified/last accessed - SetConfigValue(rConfig, _T("DateA.FilteringType"), m_iDateType1); // before/after - SetConfigValue(rConfig, _T("DateA.EnableDatePart"), m_bDate1); + SetConfigValue(rConfig, _T("DateA.Use"), m_bUseDateTime1); + SetConfigValue(rConfig, _T("DateA.Type"), m_eDateType); // created/last modified/last accessed + SetConfigValue(rConfig, _T("DateA.FilteringType"), m_eDateCmpType1); // before/after + SetConfigValue(rConfig, _T("DateA.EnableDatePart"), m_bUseDate1); SetConfigValue(rConfig, _T("DateA.DateValue"), m_tDate1.GetTime()); - SetConfigValue(rConfig, _T("DateA.EnableTimePart"), m_bTime1); + SetConfigValue(rConfig, _T("DateA.EnableTimePart"), m_bUseTime1); SetConfigValue(rConfig, _T("DateA.TimeValue"), m_tTime1.GetTime()); - SetConfigValue(rConfig, _T("DateB.Type"), m_bUseDate2); - SetConfigValue(rConfig, _T("DateB.FilteringType"), m_iDateType2); - SetConfigValue(rConfig, _T("DateB.EnableDatePart"), m_bDate2); + SetConfigValue(rConfig, _T("DateB.Type"), m_bUseDateTime2); + SetConfigValue(rConfig, _T("DateB.FilteringType"), m_eDateCmpType2); + SetConfigValue(rConfig, _T("DateB.EnableDatePart"), m_bUseDate2); SetConfigValue(rConfig, _T("DateB.DateValue"), m_tDate2.GetTime()); - SetConfigValue(rConfig, _T("DateB.EnableTimePart"), m_bTime2); + SetConfigValue(rConfig, _T("DateB.EnableTimePart"), m_bUseTime2); SetConfigValue(rConfig, _T("DateB.TimeValue"), m_tTime2.GetTime()); SetConfigValue(rConfig, _T("Attributes.Use"), m_bUseAttributes); @@ -247,52 +247,52 @@ m_astrExcludeMask.Clear(); GetConfigValue(rConfig, _T("ExcludeMask.MaskList.Mask"), m_astrExcludeMask); - if(!GetConfigValue(rConfig, _T("SizeA.Use"), m_bUseSize)) - m_bUseSize = false; - if(!GetConfigValue(rConfig, _T("SizeA.FilteringType"), m_iSizeType1)) - m_iSizeType1 = EQ; + if(!GetConfigValue(rConfig, _T("SizeA.Use"), m_bUseSize1)) + m_bUseSize1 = false; + if(!GetConfigValue(rConfig, _T("SizeA.FilteringType"), *(int*)m_eSizeCmpType1)) + m_eSizeCmpType1 = eSizeCmp_Equal; if(!GetConfigValue(rConfig, _T("SizeA.Value"), m_ullSize1)) m_ullSize1 = 0; if(!GetConfigValue(rConfig, _T("SizeB.Use"), m_bUseSize2)) m_bUseSize2 = false; - if(!GetConfigValue(rConfig, _T("SizeB.FilteringType"), m_iSizeType2)) - m_iSizeType2 = EQ; + if(!GetConfigValue(rConfig, _T("SizeB.FilteringType"), *(int*)m_eSizeCmpType2)) + m_eSizeCmpType2 = eSizeCmp_Equal; if(!GetConfigValue(rConfig, _T("SizeB.Value"), m_ullSize2)) m_ullSize2 = 0; - if(!GetConfigValue(rConfig, _T("DateA.Use"), m_bUseDate)) - m_bUseDate = false; + if(!GetConfigValue(rConfig, _T("DateA.Use"), m_bUseDateTime1)) + m_bUseDateTime1 = false; - if(!GetConfigValue(rConfig, _T("DateA.Type"), m_iDateType)) // created/last modified/last accessed - m_iDateType = DATE_CREATED; - if(!GetConfigValue(rConfig, _T("DateA.FilteringType"), m_iDateType1)) // before/after - m_iDateType1 = EQ; - if(!GetConfigValue(rConfig, _T("DateA.EnableDatePart"), m_bDate1)) - m_bDate1 = false; + if(!GetConfigValue(rConfig, _T("DateA.Type"), *(int*)m_eDateType)) // created/last modified/last accessed + m_eDateType = eDateType_Created; + if(!GetConfigValue(rConfig, _T("DateA.FilteringType"), *(int*)m_eDateCmpType1)) // before/after + m_eDateCmpType1 = eDateCmp_Equal; + if(!GetConfigValue(rConfig, _T("DateA.EnableDatePart"), m_bUseDate1)) + m_bUseDate1 = false; if(!GetConfigValue(rConfig, _T("DateA.DateValue"), tTime)) tTime = 0; m_tDate1 = tTime; - if(!GetConfigValue(rConfig, _T("DateA.EnableTimePart"), m_bTime1)) - m_bTime1 = false; + if(!GetConfigValue(rConfig, _T("DateA.EnableTimePart"), m_bUseTime1)) + m_bUseTime1 = false; if(!GetConfigValue(rConfig, _T("DateA.TimeValue"), tTime)) tTime = 0; m_tTime1 = tTime; - if(!GetConfigValue(rConfig, _T("DateB.Type"), m_bUseDate2)) + if(!GetConfigValue(rConfig, _T("DateB.Type"), m_bUseDateTime2)) + m_bUseDateTime2 = false; + if(!GetConfigValue(rConfig, _T("DateB.FilteringType"), *(int*)m_eDateCmpType2)) + m_eDateCmpType2 = eDateCmp_Equal; + if(!GetConfigValue(rConfig, _T("DateB.EnableDatePart"), m_bUseDate2)) m_bUseDate2 = false; - if(!GetConfigValue(rConfig, _T("DateB.FilteringType"), m_iDateType2)) - m_iDateType2 = EQ; - if(!GetConfigValue(rConfig, _T("DateB.EnableDatePart"), m_bDate2)) - m_bDate2 = false; if(!GetConfigValue(rConfig, _T("DateB.DateValue"), tTime)) tTime = 0; m_tDate2 = tTime; - if(!GetConfigValue(rConfig, _T("DateB.EnableTimePart"), m_bTime2)) - m_bTime2 = false; + if(!GetConfigValue(rConfig, _T("DateB.EnableTimePart"), m_bUseTime2)) + m_bUseTime2 = false; if(!GetConfigValue(rConfig, _T("DateB.TimeValue"), tTime)) tTime = 0; m_tTime2 = tTime; @@ -321,26 +321,26 @@ Serialize(rSerializer, m_bUseExcludeMask); Serialize(rSerializer, m_astrExcludeMask); - Serialize(rSerializer, m_bUseSize); - Serialize(rSerializer, m_iSizeType1); + Serialize(rSerializer, m_bUseSize1); + Serialize(rSerializer, m_eSizeCmpType1); Serialize(rSerializer, m_ullSize1); Serialize(rSerializer, m_bUseSize2); - Serialize(rSerializer, m_iSizeType2); + Serialize(rSerializer, m_eSizeCmpType2); Serialize(rSerializer, m_ullSize2); - Serialize(rSerializer, m_bUseDate); - Serialize(rSerializer, m_iDateType); // created/last modified/last accessed - Serialize(rSerializer, m_iDateType1); // before/after - Serialize(rSerializer, m_bDate1); + Serialize(rSerializer, m_bUseDateTime1); + Serialize(rSerializer, m_eDateType); // created/last modified/last accessed + Serialize(rSerializer, m_eDateCmpType1); // before/after + Serialize(rSerializer, m_bUseDate1); Serialize(rSerializer, m_tDate1); - Serialize(rSerializer, m_bTime1); + Serialize(rSerializer, m_bUseTime1); Serialize(rSerializer, m_tTime1); + Serialize(rSerializer, m_bUseDateTime2); + Serialize(rSerializer, m_eDateCmpType2); Serialize(rSerializer, m_bUseDate2); - Serialize(rSerializer, m_iDateType2); - Serialize(rSerializer, m_bDate2); Serialize(rSerializer, m_tDate2); - Serialize(rSerializer, m_bTime2); + Serialize(rSerializer, m_bUseTime2); Serialize(rSerializer, m_tTime2); Serialize(rSerializer, m_bUseAttributes); @@ -361,26 +361,26 @@ Serialize(rSerializer, m_bUseExcludeMask); Serialize(rSerializer, m_astrExcludeMask); - Serialize(rSerializer, m_bUseSize); - Serialize(rSerializer, m_iSizeType1); + Serialize(rSerializer, m_bUseSize1); + Serialize(rSerializer, m_eSizeCmpType1); Serialize(rSerializer, m_ullSize1); Serialize(rSerializer, m_bUseSize2); - Serialize(rSerializer, m_iSizeType2); + Serialize(rSerializer, m_eSizeCmpType2); Serialize(rSerializer, m_ullSize2); - Serialize(rSerializer, m_bUseDate); - Serialize(rSerializer, m_iDateType); // created/last modified/last accessed - Serialize(rSerializer, m_iDateType1); // before/after - Serialize(rSerializer, m_bDate1); + Serialize(rSerializer, m_bUseDateTime1); + Serialize(rSerializer, m_eDateType); // created/last modified/last accessed + Serialize(rSerializer, m_eDateCmpType1); // before/after + Serialize(rSerializer, m_bUseDate1); Serialize(rSerializer, m_tDate1); - Serialize(rSerializer, m_bTime1); + Serialize(rSerializer, m_bUseTime1); Serialize(rSerializer, m_tTime1); + Serialize(rSerializer, m_bUseDateTime2); + Serialize(rSerializer, m_eDateCmpType2); Serialize(rSerializer, m_bUseDate2); - Serialize(rSerializer, m_iDateType2); - Serialize(rSerializer, m_bDate2); Serialize(rSerializer, m_tDate2); - Serialize(rSerializer, m_bTime2); + Serialize(rSerializer, m_bUseTime2); Serialize(rSerializer, m_tTime2); Serialize(rSerializer, m_bUseAttributes); @@ -417,27 +417,27 @@ } // by size - if (m_bUseSize) + if (m_bUseSize1) { - switch (m_iSizeType1) + switch (m_eSizeCmpType1) { - case LT: + case eSizeCmp_Less: if (m_ullSize1 <= spInfo->GetLength64()) return false; break; - case LE: + case eSizeCmp_LessOrEqual: if (m_ullSize1 < spInfo->GetLength64()) return false; break; - case EQ: + case eSizeCmp_Equal: if (m_ullSize1 != spInfo->GetLength64()) return false; break; - case GE: + case eSizeCmp_GreaterOrEqual: if (m_ullSize1 > spInfo->GetLength64()) return false; break; - case GT: + case eSizeCmp_Greater: if (m_ullSize1 >= spInfo->GetLength64()) return false; break; @@ -446,25 +446,25 @@ // second part if (m_bUseSize2) { - switch (m_iSizeType2) + switch (m_eSizeCmpType2) { - case LT: + case eSizeCmp_Less: if (m_ullSize2 <= spInfo->GetLength64()) return false; break; - case LE: + case eSizeCmp_LessOrEqual: if (m_ullSize2 < spInfo->GetLength64()) return false; break; - case EQ: + case eSizeCmp_Equal: if (m_ullSize2 != spInfo->GetLength64()) return false; break; - case GE: + case eSizeCmp_GreaterOrEqual: if (m_ullSize2 > spInfo->GetLength64()) return false; break; - case GT: + case eSizeCmp_Greater: if (m_ullSize2 >= spInfo->GetLength64()) return false; break; @@ -473,97 +473,97 @@ } // date - get the time from rInfo - if (m_bUseDate) + if (m_bUseDateTime1) { COleDateTime tm; - switch (m_iDateType) + switch (m_eDateType) { - case DATE_CREATED: + case eDateType_Created: tm=spInfo->GetCreationTime(); break; - case DATE_MODIFIED: + case eDateType_Modified: tm=spInfo->GetLastWriteTime(); break; - case DATE_LASTACCESSED: + case eDateType_LastAccessed: tm=spInfo->GetLastAccessTime(); break; } // counting... unsigned long ulInfo=0, ulCheck=0; - if (m_bDate1) + if (m_bUseDate1) { ulInfo=(tm.GetYear()-1970)*32140800+tm.GetMonth()*2678400+tm.GetDay()*86400; ulCheck=(m_tDate1.GetYear()-1970)*32140800+m_tDate1.GetMonth()*2678400+m_tDate1.GetDay()*86400; } - if (m_bTime1) + if (m_bUseTime1) { ulInfo+=tm.GetHour()*3600+tm.GetMinute()*60+tm.GetSecond(); ulCheck+=m_tTime1.GetHour()*3600+m_tTime1.GetMinute()*60+m_tTime1.GetSecond(); } // ... and comparing - switch (m_iDateType1) + switch (m_eDateCmpType1) { - case LT: + case eDateCmp_Less: if (ulInfo >= ulCheck) return false; break; - case LE: + case eDateCmp_LessOrEqual: if (ulInfo > ulCheck) return false; break; - case EQ: + case eDateCmp_Equal: if (ulInfo != ulCheck) return false; break; - case GE: + case eDateCmp_GreaterOrEqual: if (ulInfo < ulCheck) return false; break; - case GT: + case eDateCmp_Greater: if (ulInfo <= ulCheck) return false; break; } - if (m_bUseDate2) + if (m_bUseDateTime2) { // counting... ulInfo=0, ulCheck=0; - if (m_bDate2) + if (m_bUseDate2) { ulInfo=(tm.GetYear()-1970)*32140800+tm.GetMonth()*2678400+tm.GetDay()*86400; ulCheck=(m_tDate2.GetYear()-1970)*32140800+m_tDate2.GetMonth()*2678400+m_tDate2.GetDay()*86400; } - if (m_bTime2) + if (m_bUseTime2) { ulInfo+=tm.GetHour()*3600+tm.GetMinute()*60+tm.GetSecond(); ulCheck+=m_tTime2.GetHour()*3600+m_tTime2.GetMinute()*60+m_tTime2.GetSecond(); } // ... comparing - switch (m_iDateType2) + switch (m_eDateCmpType2) { - case LT: + case eDateCmp_Less: if (ulInfo >= ulCheck) return false; break; - case LE: + case eDateCmp_LessOrEqual: if (ulInfo > ulCheck) return false; break; - case EQ: + case eDateCmp_Equal: if (ulInfo != ulCheck) return false; break; - case GE: + case eDateCmp_GreaterOrEqual: if (ulInfo < ulCheck) return false; break; - case GT: + case eDateCmp_Greater: if (ulInfo <= ulCheck) return false; break; Index: src/ch/FileFilter.h =================================================================== diff -u -rde5a63babb2991c808333230014a4f2e6cc8b7b2 -r10d4c73f3589c377ec0b60a2a053ff6aafeb507f --- src/ch/FileFilter.h (.../FileFilter.h) (revision de5a63babb2991c808333230014a4f2e6cc8b7b2) +++ src/ch/FileFilter.h (.../FileFilter.h) (revision 10d4c73f3589c377ec0b60a2a053ff6aafeb507f) @@ -21,23 +21,37 @@ #include "FileInfo.h" -// definitions for comparing sizes and dates -#define LT 0 -#define LE 1 -#define EQ 2 -#define GE 3 -#define GT 4 - -// date type defs -#define DATE_CREATED 0 -#define DATE_MODIFIED 1 -#define DATE_LASTACCESSED 2 - namespace chcore { class TConfig; } class CFileFilter { public: + enum ESizeCompareType + { + eSizeCmp_Less = 0, + eSizeCmp_LessOrEqual = 1, + eSizeCmp_Equal = 2, + eSizeCmp_GreaterOrEqual = 3, + eSizeCmp_Greater = 4 + }; + + enum EDateCompareType + { + eDateCmp_Less = 0, + eDateCmp_LessOrEqual = 1, + eDateCmp_Equal = 2, + eDateCmp_GreaterOrEqual = 3, + eDateCmp_Greater = 4 + }; + + enum EDateType + { + eDateType_Created = 0, + eDateType_Modified = 1, + eDateType_LastAccessed = 2 + }; + +public: CFileFilter(); CFileFilter(const CFileFilter& rFilter); CFileFilter& operator=(const CFileFilter& rFilter); @@ -56,50 +70,146 @@ void Serialize(chcore::TReadBinarySerializer& rSerializer); void Serialize(chcore::TWriteBinarySerializer& rSerializer) const; + // atrributes access + bool GetUseMask() const { return m_bUseMask; } + void SetUseMask(bool bUseMask) { m_bUseMask = bUseMask; } + +// const chcore::TStringArray& GetMaskArray() const { return m_astrMask; } +// chcore::TStringArray& GetMaskArray() { return m_astrMask; } + + bool GetUseExcludeMask() const { return m_bUseExcludeMask; } + void SetUseExcludeMask(bool bUseExcludeMask) { m_bUseExcludeMask = bUseExcludeMask; } + +// const chcore::TStringArray& GetExcludeMaskArray() const { return m_astrExcludeMask; } +// chcore::TStringArray& GetExcludeMaskArray() { return m_astrExcludeMask; } + + bool GetUseSize1() const { return m_bUseSize1; } + void SetUseSize1(bool bUseSize1) { m_bUseSize1 = bUseSize1; } + + ESizeCompareType GetSizeType1() const { return m_eSizeCmpType1; } + void SetSizeType1(ESizeCompareType eSizeType1) { m_eSizeCmpType1 = eSizeType1; } + + unsigned long long GetSize1() const { return m_ullSize1; } + void SetSize1(unsigned long long ullSize1) { m_ullSize1 = ullSize1; } + + bool GetUseSize2() const { return m_bUseSize2; } + void SetUseSize2(bool bUseSize2) { m_bUseSize2 = bUseSize2; } + + ESizeCompareType GetSizeType2() const { return m_eSizeCmpType2; } + void SetSizeType2(ESizeCompareType eSizeType2) { m_eSizeCmpType2 = eSizeType2; } + + unsigned long long GetSize2() const { return m_ullSize2; } + void SetSize2(unsigned long long ullSize2) { m_ullSize2 = ullSize2; } + + // dates + CFileFilter::EDateType GetDateType() const { return m_eDateType; } + void SetDateType(CFileFilter::EDateType eDateType) { m_eDateType = eDateType; } + + // date 1 + bool GetUseDateTime1() const { return m_bUseDateTime1; } + void SetUseDateTime1(bool bUseDateTime1) { m_bUseDateTime1 = bUseDateTime1; } + + CFileFilter::EDateCompareType GetDateCmpType1() const { return m_eDateCmpType1; } + void SetDateCmpType1(CFileFilter::EDateCompareType eCmpType1) { m_eDateCmpType1 = eCmpType1; } + + bool GetUseDate1() const { return m_bUseDate1; } + void SetUseDate1(bool tDate1) { m_bUseDate1 = tDate1; } + + const CTime& GetDate1() const { return m_tDate1; } + void SetDate1(const CTime& tDate1) { m_tDate1 = tDate1; } + + bool GetUseTime1() const { return m_bUseTime1; } + void SetUseTime1(bool tTime1) { m_bUseTime1 = tTime1; } + + const CTime& GetTime1() const { return m_tTime1; } + void SetTime1(const CTime& val) { m_tTime1 = val; } + + // date 2 + bool GetUseDateTime2() const { return m_bUseDateTime2; } + void SetUseDateTime2(bool bUseDateTime2) { m_bUseDateTime2 = bUseDateTime2; } + + CFileFilter::EDateCompareType GetDateCmpType2() const { return m_eDateCmpType2; } + void SetDateCmpType2(CFileFilter::EDateCompareType eCmpType2) { m_eDateCmpType2 = eCmpType2; } + + bool GetUseDate2() const { return m_bUseDate2; } + void SetUseDate2(bool tDate2) { m_bUseDate2 = tDate2; } + + const CTime& GetDate2() const { return m_tDate2; } + void SetDate2(const CTime& tDate2) { m_tDate2 = tDate2; } + + bool GetUseTime2() const { return m_bUseTime2; } + void SetUseTime2(bool tTime2) { m_bUseTime2 = tTime2; } + + const CTime& GetTime2() const { return m_tTime2; } + void SetTime2(const CTime& val) { m_tTime2 = val; } + + // attributes + bool GetUseAttributes() const { return m_bUseAttributes; } + void SetUseAttributes(bool bUseAttributes) { m_bUseAttributes = bUseAttributes; } + + int GetArchive() const { return m_iArchive; } + void SetArchive(int iArchive) { m_iArchive = iArchive; } + + int GetReadOnly() const { return m_iReadOnly; } + void SetReadOnly(int iReadOnly) { m_iReadOnly = iReadOnly; } + + int GetHidden() const { return m_iHidden; } + void SetHidden(int iHidden) { m_iHidden = iHidden; } + + int GetSystem() const { return m_iSystem; } + void SetSystem(int iSystem) { m_iSystem = iSystem; } + + int GetDirectory() const { return m_iDirectory; } + void SetDirectory(int iDirectory) { m_iDirectory = iDirectory; } + protected: bool MatchMask(LPCTSTR lpszMask, LPCTSTR lpszString) const; bool Scan(LPCTSTR& lpszMask, LPCTSTR& lpszString) const; -public: - // files mask - bool m_bUseMask; - chcore::TStringArray m_astrMask; +private: + // files mask + bool m_bUseMask; + chcore::TStringArray m_astrMask; - // files mask- - bool m_bUseExcludeMask; - chcore::TStringArray m_astrExcludeMask; + // files mask- + bool m_bUseExcludeMask; + chcore::TStringArray m_astrExcludeMask; - // size filtering - bool m_bUseSize; - int m_iSizeType1; - unsigned __int64 m_ullSize1; - bool m_bUseSize2; - int m_iSizeType2; - unsigned __int64 m_ullSize2; + // size filtering + bool m_bUseSize1; + ESizeCompareType m_eSizeCmpType1; + unsigned long long m_ullSize1; - // date filtering - bool m_bUseDate; - int m_iDateType; // created/last modified/last accessed - int m_iDateType1; // before/after - bool m_bDate1; - CTime m_tDate1; - bool m_bTime1; - CTime m_tTime1; + bool m_bUseSize2; + ESizeCompareType m_eSizeCmpType2; + unsigned long long m_ullSize2; - bool m_bUseDate2; - int m_iDateType2; - bool m_bDate2; - CTime m_tDate2; - bool m_bTime2; - CTime m_tTime2; + // date filtering + EDateType m_eDateType; // created/last modified/last accessed - // attribute filtering - bool m_bUseAttributes; - int m_iArchive; - int m_iReadOnly; - int m_iHidden; - int m_iSystem; - int m_iDirectory; + bool m_bUseDateTime1; + + EDateCompareType m_eDateCmpType1; // before/after + bool m_bUseDate1; + CTime m_tDate1; + bool m_bUseTime1; + CTime m_tTime1; + + bool m_bUseDateTime2; + + EDateCompareType m_eDateCmpType2; + bool m_bUseDate2; + CTime m_tDate2; + bool m_bUseTime2; + CTime m_tTime2; + + // attribute filtering + bool m_bUseAttributes; + int m_iArchive; + int m_iReadOnly; + int m_iHidden; + int m_iSystem; + int m_iDirectory; }; class CFiltersArray Index: src/ch/FilterDlg.cpp =================================================================== diff -u -rde5a63babb2991c808333230014a4f2e6cc8b7b2 -r10d4c73f3589c377ec0b60a2a053ff6aafeb507f --- src/ch/FilterDlg.cpp (.../FilterDlg.cpp) (revision de5a63babb2991c808333230014a4f2e6cc8b7b2) +++ src/ch/FilterDlg.cpp (.../FilterDlg.cpp) (revision 10d4c73f3589c377ec0b60a2a053ff6aafeb507f) @@ -37,7 +37,7 @@ //{{AFX_DATA_INIT(CFilterDlg) m_iArchive = FALSE; m_bAttributes = FALSE; - m_bDate = FALSE; + m_bDate1 = FALSE; m_bDate2 = FALSE; m_iDirectory = FALSE; m_bFilter = FALSE; @@ -74,7 +74,7 @@ DDX_Control(pDX, IDC_DATE1_DATETIMEPICKER, m_ctlDate1); DDX_Check(pDX, IDC_ARCHIVE_CHECK, m_iArchive); DDX_Check(pDX, IDC_ATTRIBUTES_CHECK, m_bAttributes); - DDX_Check(pDX, IDC_DATE_CHECK, m_bDate); + DDX_Check(pDX, IDC_DATE_CHECK, m_bDate1); DDX_Check(pDX, IDC_DATE2_CHECK, m_bDate2); DDX_Check(pDX, IDC_DIRECTORY_CHECK, m_iDirectory); DDX_Check(pDX, IDC_FILTER_CHECK, m_bFilter); @@ -136,57 +136,59 @@ } // copy data from CFileFilter to a dialog - mask - m_bFilter=m_ffFilter.m_bUseMask; + m_bFilter = m_ffFilter.GetUseMask(); chcore::TString strData; m_ctlFilter.SetCurSel(m_ctlFilter.AddString(m_ffFilter.GetCombinedMask(strData))); for (int i=0;iEnableWindow(m_bDate && bSecond); - m_ctlDateType1.EnableWindow(m_bDate); - m_ctlDateType2.EnableWindow(m_bDate && m_bDate2 && bSecond); - m_ctlDate1.EnableWindow(m_bDate); - m_ctlDate2.EnableWindow(m_bDate && m_bDate2 && bSecond); - m_ctlTime1.EnableWindow(m_bDate); - m_ctlTime2.EnableWindow(m_bDate && m_bDate2 && bSecond); + m_ctlDateType.EnableWindow(m_bDate1); + GetDlgItem(IDC_DATE2_CHECK)->EnableWindow(m_bDate1 && bSecond); + m_ctlDateType1.EnableWindow(m_bDate1); + m_ctlDateType2.EnableWindow(m_bDate1 && m_bDate2 && bSecond); + m_ctlDate1.EnableWindow(m_bDate1); + m_ctlDate2.EnableWindow(m_bDate1 && m_bDate2 && bSecond); + m_ctlTime1.EnableWindow(m_bDate1); + m_ctlTime2.EnableWindow(m_bDate1 && m_bDate2 && bSecond); // attrib GetDlgItem(IDC_ARCHIVE_CHECK)->EnableWindow(m_bAttributes); @@ -335,44 +337,49 @@ // CFileFilter --> dialogu - mask CString strText; m_ctlFilter.GetWindowText(strText); - m_ffFilter.m_bUseMask=((m_bFilter != 0) && !strText.IsEmpty()); + m_ffFilter.SetUseMask(((m_bFilter != 0) && !strText.IsEmpty())); m_ffFilter.SetCombinedMask((PCTSTR)strText); m_ctlExcludeMask.GetWindowText(strText); - m_ffFilter.m_bUseExcludeMask=(m_bExclude != 0) && !strText.IsEmpty(); + m_ffFilter.SetUseExcludeMask((m_bExclude != 0) && !strText.IsEmpty()); m_ffFilter.SetCombinedExcludeMask((PCTSTR)strText); // size - m_ffFilter.m_bUseSize=(m_bSize != 0); - m_ffFilter.m_bUseSize2=(m_bSize2 != 0); + m_ffFilter.SetUseSize1(m_bSize != 0); + m_ffFilter.SetUseSize2(m_bSize2 != 0); - m_ffFilter.m_iSizeType1=m_ctlSizeType1.GetCurSel(); - m_ffFilter.m_iSizeType2=m_ctlSizeType2.GetCurSel(); + m_ffFilter.SetSizeType1((CFileFilter::ESizeCompareType)m_ctlSizeType1.GetCurSel()); + m_ffFilter.SetSizeType2((CFileFilter::ESizeCompareType)m_ctlSizeType2.GetCurSel()); - m_ffFilter.m_ullSize1=static_cast(m_uiSize1)*static_cast(GetMultiplier(m_ctlSize1Multi.GetCurSel())); - m_ffFilter.m_ullSize2=static_cast(m_uiSize2)*static_cast(GetMultiplier(m_ctlSize2Multi.GetCurSel())); + m_ffFilter.SetSize1(static_cast(m_uiSize1)*static_cast(GetMultiplier(m_ctlSize1Multi.GetCurSel()))); + m_ffFilter.SetSize2(static_cast(m_uiSize2)*static_cast(GetMultiplier(m_ctlSize2Multi.GetCurSel()))); // date - m_ffFilter.m_iDateType=m_ctlDateType.GetCurSel(); + m_ffFilter.SetDateType((CFileFilter::EDateType)m_ctlDateType.GetCurSel()); - m_ffFilter.m_iDateType1=m_ctlDateType1.GetCurSel(); - m_ffFilter.m_iDateType2=m_ctlDateType2.GetCurSel(); + m_ffFilter.SetDateCmpType1((CFileFilter::EDateCompareType)m_ctlDateType1.GetCurSel()); + m_ffFilter.SetDateCmpType2((CFileFilter::EDateCompareType)m_ctlDateType2.GetCurSel()); - m_ffFilter.m_bDate1=m_ctlDate1.GetTime(m_ffFilter.m_tDate1) == GDT_VALID; - m_ffFilter.m_bDate2=m_ctlDate2.GetTime(m_ffFilter.m_tDate2) == GDT_VALID; - m_ffFilter.m_bTime1=m_ctlTime1.GetTime(m_ffFilter.m_tTime1) == GDT_VALID; - m_ffFilter.m_bTime2=m_ctlTime2.GetTime(m_ffFilter.m_tTime2) == GDT_VALID; + CTime tDateTime; + m_ffFilter.SetUseDate1(m_ctlDate1.GetTime(tDateTime) == GDT_VALID); + m_ffFilter.SetDate1(tDateTime); + m_ffFilter.SetUseDate2(m_ctlDate2.GetTime(tDateTime) == GDT_VALID); + m_ffFilter.SetDate2(tDateTime); + m_ffFilter.SetUseTime1(m_ctlTime1.GetTime(tDateTime) == GDT_VALID); + m_ffFilter.SetTime1(tDateTime); + m_ffFilter.SetUseTime2(m_ctlTime2.GetTime(tDateTime) == GDT_VALID); + m_ffFilter.SetTime2(tDateTime); - m_ffFilter.m_bUseDate=(m_bDate != 0) && (m_ffFilter.m_bDate1 || m_ffFilter.m_bTime1); - m_ffFilter.m_bUseDate2=(m_bDate2 != 0) && (m_ffFilter.m_bDate2 || m_ffFilter.m_bTime2); + m_ffFilter.SetUseDateTime1((m_bDate1 != 0) && (m_ffFilter.GetUseDate1() || m_ffFilter.GetUseTime1())); + m_ffFilter.SetUseDateTime2((m_bDate2 != 0) && (m_ffFilter.GetUseDate2() || m_ffFilter.GetUseTime2())); // attributes - m_ffFilter.m_bUseAttributes=(m_bAttributes != 0); - m_ffFilter.m_iArchive=m_iArchive; - m_ffFilter.m_iReadOnly=m_iReadOnly; - m_ffFilter.m_iHidden=m_iHidden; - m_ffFilter.m_iSystem=m_iSystem; - m_ffFilter.m_iDirectory=m_iDirectory; + m_ffFilter.SetUseAttributes(m_bAttributes != 0); + m_ffFilter.SetArchive(m_iArchive); + m_ffFilter.SetReadOnly(m_iReadOnly); + m_ffFilter.SetHidden(m_iHidden); + m_ffFilter.SetSystem(m_iSystem); + m_ffFilter.SetDirectory(m_iDirectory); CLanguageDialog::OnOK(); } Index: src/ch/FilterDlg.h =================================================================== diff -u -r22bbc4a87fa0b249e1e02ba385f28da9d77a4aa1 -r10d4c73f3589c377ec0b60a2a053ff6aafeb507f --- src/ch/FilterDlg.h (.../FilterDlg.h) (revision 22bbc4a87fa0b249e1e02ba385f28da9d77a4aa1) +++ src/ch/FilterDlg.h (.../FilterDlg.h) (revision 10d4c73f3589c377ec0b60a2a053ff6aafeb507f) @@ -48,7 +48,7 @@ CDateTimeCtrl m_ctlDate1; int m_iArchive; BOOL m_bAttributes; - BOOL m_bDate; + BOOL m_bDate1; BOOL m_bDate2; int m_iDirectory; BOOL m_bFilter;