OSDN Git Service

2005-06-02 Perry
authorPerry Rapp <elsapo@users.sourceforge.net>
Thu, 2 Jun 2005 15:39:36 +0000 (15:39 +0000)
committerPerry Rapp <elsapo@users.sourceforge.net>
Thu, 2 Jun 2005 15:39:36 +0000 (15:39 +0000)
 PATCH: [ 1213161 ] Set return code based on last diff result
 Src: DirDoc.cpp Merge.cpp Merge.h MergeDoc.cpp

Src/DirDoc.cpp
Src/Merge.cpp
Src/Merge.h
Src/MergeDoc.cpp
Src/readme.txt

index b290d3c..62b02b8 100644 (file)
@@ -336,11 +336,14 @@ void CDirDoc::Redisplay()
        if (!m_bRecursive)
                cnt += m_pDirView->AddSpecialItems();
 
+       int alldiffs=0;
        POSITION diffpos = m_pCtxt->GetFirstDiffPosition();
        while (diffpos)
        {
                POSITION curdiffpos = diffpos;
                DIFFITEM di = m_pCtxt->GetNextDiffPosition(diffpos);
+               if (!di.isResultSame())
+                       ++alldiffs;
 
                LPCTSTR p=GetItemPathIfShowable(m_pCtxt, di, llen, rlen);
 
@@ -351,6 +354,7 @@ void CDirDoc::Redisplay()
                        cnt++;
                }
        }
+       theApp.SetLastCompareResult(alldiffs);
        m_pDirView->SortColumnsAppropriately();
        m_pDirView->SetRedraw(TRUE);
 }
index 36a383f..0afdb5a 100644 (file)
@@ -83,6 +83,9 @@ CMergeApp::CMergeApp() :
 , m_pDiffTemplate(0)
 , m_pDirTemplate(0)
 , m_lang(IDR_MAINFRAME, IDR_MAINFRAME)
+// FileFilterHelper m_globalFileFilter
+, m_mainThreadScripts(NULL)
+, m_nLastCompareResult(0)
 {
        // TODO: add construction code here,
        // Place all significant initialization in InitInstance
@@ -640,7 +643,8 @@ void CMergeApp::OnViewLanguage()
 int CMergeApp::ExitInstance() 
 {
        delete m_mainThreadScripts;
-       return CWinApp::ExitInstance();
+       CWinApp::ExitInstance();
+       return m_nLastCompareResult;
 }
 
 
index f4b79e8..2080445 100644 (file)
@@ -62,7 +62,10 @@ public:
        FileFilterHelper m_globalFileFilter;
 
        CMergeApp();
+
+public:
        void SetNeedIdleTimer();
+       void SetLastCompareResult(int nResult) { m_nLastCompareResult = nResult; }
 
 // Implementation
 protected:
@@ -94,6 +97,7 @@ protected:
        DECLARE_MESSAGE_MAP()
 private:
        CAssureScriptsForThread * m_mainThreadScripts;
+       int m_nLastCompareResult;
 };
 
 extern CMergeApp theApp;
index fedf82b..25a634d 100644 (file)
@@ -456,6 +456,8 @@ int CMergeDoc::Rescan(BOOL &bBinary, BOOL &bIdentical,
                m_bRightEditAfterRescan = FALSE;
        }
 
+       theApp.SetLastCompareResult(bIdentical ? 0 : 1);
+
        m_leftRescanFileInfo.Update(m_filePaths.GetLeft());
        m_rightRescanFileInfo.Update(m_filePaths.GetRight());
 
index 5bc59f2..7ceb9d3 100644 (file)
@@ -1,3 +1,7 @@
+2005-06-02 Perry
+ PATCH: [ 1213161 ] Set return code based on last diff result
+ Src: DirDoc.cpp Merge.cpp Merge.h MergeDoc.cpp
+
 2005-06-01 Perry
  Add commenting & array bounds checking to CMergeApp::LoadProjectFile
   Src: Merge.cpp