/**
* @brief Start directory compare thread
*/
-UINT CDiffThread::CompareDirectories(CString dir1, CString dir2)
+UINT CDiffThread::CompareDirectories(CString dir1, CString dir2, BOOL bRecursive)
{
diffParam.path1 = dir1;
diffParam.path2 = dir2;
+ diffParam.bRecursive = bRecursive;
diffParam.context = m_pDiffContext;
diffParam.msgUIUpdate = m_msgUpdateUI;
diffParam.hWindow = m_hWnd;
/**
* @brief Directory compare thread function
+ *
* Calls diffutils's compare_files() and after compare is ready
* sends message to UI so UI can update itself.
*/
UINT msgID = myStruct->msgUIUpdate;
bool casesensitive = false;
- int depth = -1;
+ int depth = myStruct->bRecursive ? -1 : 0;
CString subdir; // blank to start at roots specified in diff context
DirScan(subdir, myStruct->context, casesensitive, depth);
UINT msgStatusUpdate;
HWND hWindow;
UINT nThreadState;
+ BOOL bRecursive;
};
/**
CDiffThread();
~CDiffThread();
CDiffContext * SetContext(CDiffContext * pCtx);
- UINT CompareDirectories(CString dir1, CString dir2);
+ UINT CompareDirectories(CString dir1, CString dir2, BOOL bRecursive);
void SetHwnd(HWND hWnd);
void SetMessageIDs(UINT updateMsg, UINT statusMsg);
UINT GetThreadState();
#include "paths.h"
#include "WaitStatusCursor.h"
-extern int recursive;
-
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
m_pCtxt=NULL;
m_bReuseMergeDocs = TRUE;
m_pFilter = NULL;
+ m_bRecursive = FALSE;
}
CDirDoc::~CDirDoc()
m_diffThread.SetHwnd(m_pDirView->GetSafeHwnd());
m_diffThread.SetMessageIDs(MSG_UI_UPDATE, MSG_STAT_UPDATE);
m_diffThread.CompareDirectories(m_pCtxt->m_strNormalizedLeft,
- m_pCtxt->m_strNormalizedRight);
+ m_pCtxt->m_strNormalizedRight, m_bRecursive);
gLog.Write(_T("Directory scan complete\r\n"));
else
return m_bRORight;
}
+
+/**
+ * @brief Enable/disable recursive directory compare
+ */
+void CDirDoc::SetRecursive(BOOL bRecursive)
+{
+ m_bRecursive = bRecursive;
+}
// Implementation
public:
+ void SetRecursive(BOOL bRecursive);
BOOL GetReadOnly(BOOL bLeft) const;
void SetReadOnly(BOOL bLeft, BOOL bReadOnly);
void ReadSettings();
BOOL m_bReuseMergeDocs; // policy to reuse existing merge docs
BOOL m_bROLeft;
BOOL m_bRORight;
+ BOOL m_bRecursive;
};
/// callback for file/directory filtering during diff
static char THIS_FILE[] = __FILE__;
#endif
-extern int recursive;
CMainFrame *mf = NULL;
CLogFile gLog(_T("WinMerge.log"), NULL, TRUE);
// open the diff
if (pathsType == IS_EXISTING_DIR)
{
- recursive = bRecurse;
-
if (pDirDoc)
{
CDiffContext *pCtxt = new CDiffContext(strLeft, strRight);
{
pDirDoc->SetReadOnly(TRUE, FALSE);
pDirDoc->SetReadOnly(FALSE, FALSE);
+ pDirDoc->SetRecursive(bRecurse);
pDirDoc->SetDiffContext(pCtxt);
pCtxt->SetRegExp(strExt);
pDirDoc->Rescan();
}
else
{
- recursive = FALSE;
ShowMergeDoc(pDirDoc, strLeft, strRight);
}
return TRUE;
+2003-09-07 Kimmo
+ PATCH: [ 800420 ] Fix recursive compare and cleanup recursive usage
+ WinMerge: DiffThread.h DiffThread.cpp DirDoc.h DirDoc.cpp MainFrm.cpp
+
2003-09-06 Perry
PATCH: [ 795082 ] Display Private Build version in about box
WinMerge: Merge.cpp Merge.rc resource.h