2005-10-21 Kimmo
PATCH: [ 1333545 ] Small improvement to Open-dialog folder selection
Src: OpenDlg.cpp
+ PATCH: [ 1333581 ] Increase quick compare limit and make it option
+ Src: DiffContext.h DiffWrapper.cpp DirDoc.cpp OptionsDef.h OptionsInit.cpp
2005-10-20 Tim
PATCH: [ 1330179 ] Icon for 'Print'
BOOL m_bIgnoreSmallTimeDiff; /**< Ignore small timedifferences when comparing by date */
CompareStats *m_pCompareStats;
BOOL m_bStopAfterFirstDiff; /**< Optimize compare by stopping after first difference? */
+ int m_nQuickCompareLimit; /**< Bigger files are always compared with quick compare */
private:
CList<DIFFITEM,DIFFITEM&> *m_pList; /**< Pointer to list, used to access list */
extern CLogFile gLog;
static int f_defcp = 0; // default codepage
static const int KILO = 1024; // Kilo(byte)
-static const int MEG = 1024 * KILO; // Mega(byte)
-
-/**
- * @brief Limit for compare by contents/quick contents.
- * If compare by contents is selected (normal) then files bigger than limit
- * are compared with compare by quick contents. That allows us to compare
- * big binary files and overall makes comparing bigger files faster.
- */
-static const int CMP_SIZE_LIMIT = 2 * MEG;
/**
* @brief Quick contents compare's file buffer size
}
}
- // If either file is larger than 2 Megs compare files by quick contents
+ // If either file is larger than limit compare files by quick contents
// This allows us to (faster) compare big binary files
if (pCtxt->m_nCompMethod == CMP_CONTENT &&
- (di.left.size > CMP_SIZE_LIMIT || di.right.size > CMP_SIZE_LIMIT))
+ (di.left.size > pCtxt->m_nQuickCompareLimit ||
+ di.right.size > pCtxt->m_nQuickCompareLimit))
{
nCompMethod = CMP_QUICK_CONTENT;
}
m_pCtxt->m_nCompMethod = mf->m_options.GetInt(OPT_CMP_METHOD);
m_pCtxt->m_bIgnoreSmallTimeDiff = mf->m_options.GetBool(OPT_IGNORE_SMALL_FILETIME);
m_pCtxt->m_bStopAfterFirstDiff = mf->m_options.GetBool(OPT_CMP_STOP_AFTER_FIRST);
+ m_pCtxt->m_nQuickCompareLimit = mf->m_options.GetInt(OPT_CMP_QUICK_LIMIT);
m_pCtxt->m_pCompareStats = m_pCompareStats;
// Set total items count since we don't collect items
const TCHAR OPT_CMP_METHOD[] = _T("Settings/CompMethod");
const TCHAR OPT_CMP_MOVED_BLOCKS[] = _T("Settings/MovedBlocks");
const TCHAR OPT_CMP_STOP_AFTER_FIRST[] = _T("Settings/StopAfterFirst");
+const TCHAR OPT_CMP_QUICK_LIMIT[] = _T("Settings/QuickMethodLimit");
// Multidoc enable/disable per document type
const TCHAR OPT_MULTIDOC_DIRDOCS[] = _T("Settings/MultiDirDocs");
m_options.InitOption(OPT_CMP_METHOD, (int)CMP_CONTENT);
m_options.InitOption(OPT_CMP_MOVED_BLOCKS, false);
m_options.InitOption(OPT_CMP_STOP_AFTER_FIRST, false);
+ m_options.InitOption(OPT_CMP_QUICK_LIMIT, 4 * 1024 * 1024); // 4 Megs
m_options.InitOption(OPT_CLR_DIFF, (int)RGB(239,203,5));
m_options.InitOption(OPT_CLR_SELECTED_DIFF, (int)RGB(239,119,116));