From 5c0966b6c5af949c87496b2922e470f002a774b7 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Wed, 15 Sep 2010 21:10:02 +0800 Subject: [PATCH] Fix tortoiseshell build error and fix ESC[F at progressdlg Signed-off-by: Frank Li --- src/TortoiseProc/GitStatusListCtrlHelpers.cpp | 6 +++++- src/TortoiseProc/ProgressDlg.cpp | 14 +++++++++++++- src/TortoiseProc/ProgressDlg.h | 4 +++- src/TortoiseShell/TortoiseShell.vcproj | 4 ++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/TortoiseProc/GitStatusListCtrlHelpers.cpp b/src/TortoiseProc/GitStatusListCtrlHelpers.cpp index 7c1875fee..dd0d8ab99 100644 --- a/src/TortoiseProc/GitStatusListCtrlHelpers.cpp +++ b/src/TortoiseProc/GitStatusListCtrlHelpers.cpp @@ -21,6 +21,10 @@ #include ".\resource.h" #include "GitStatusListCtrl.h" #include + +#ifndef assert +#define assert(x) ATLASSERT(x) +#endif // assign property list #if 0 PropertyList& @@ -226,7 +230,7 @@ int ColumnManager::GetColumnCount() const bool ColumnManager::IsVisible (int column) const { size_t index = static_cast(column); - assert (columns.size() > index); + assert (columns.size() > index); return columns[index].visible; } diff --git a/src/TortoiseProc/ProgressDlg.cpp b/src/TortoiseProc/ProgressDlg.cpp index c3c13c544..d11a2ccb0 100644 --- a/src/TortoiseProc/ProgressDlg.cpp +++ b/src/TortoiseProc/ProgressDlg.cpp @@ -270,8 +270,13 @@ LRESULT CProgressDlg::OnProgressUpdateUI(WPARAM wParam,LPARAM lParam) m_Databuf.m_critSec.Lock(); for(int i=this->m_BufStart;im_Databuf.size();i++) { - ParserCmdOutput(this->m_Databuf[m_BufStart]); + char c = this->m_Databuf[m_BufStart]; m_BufStart++; + m_Databuf.m_critSec.Unlock(); + + ParserCmdOutput(c); + + m_Databuf.m_critSec.Lock(); } if(m_BufStart>1000) @@ -363,6 +368,11 @@ void CProgressDlg::ParserCmdOutput(char ch) { ParserCmdOutput(this->m_Log,this->m_Progress,this->m_LogTextA,ch,&this->m_CurrentWork); } +void CProgressDlg::ClearESC(CStringA &str) +{ + int start=0; + str.Replace("\033[K",""); +} void CProgressDlg::ParserCmdOutput(CRichEditCtrl &log,CProgressCtrl &progressctrl,CStringA &oneline, char ch, CWnd *CurrentWork) { //TRACE(_T("%c"),ch); @@ -373,6 +383,8 @@ void CProgressDlg::ParserCmdOutput(CRichEditCtrl &log,CProgressCtrl &progressctr TRACE(_T("End Char %s \r\n"),ch==_T('\r')?_T("lf"):_T("")); TRACE(_T("End Char %s \r\n"),ch==_T('\n')?_T("cr"):_T("")); + ClearESC(oneline); + int lines=log.GetLineCount(); g_Git.StringAppend(&str,(BYTE*)oneline.GetBuffer(),CP_ACP); diff --git a/src/TortoiseProc/ProgressDlg.h b/src/TortoiseProc/ProgressDlg.h index df512bfb3..403b782aa 100644 --- a/src/TortoiseProc/ProgressDlg.h +++ b/src/TortoiseProc/ProgressDlg.h @@ -78,7 +78,9 @@ public: //Share with Sync Dailog static int FindPercentage(CString &log); - + + static void ClearESC(CStringA &str); + static void ParserCmdOutput(CRichEditCtrl &log,CProgressCtrl &progressctrl, CStringA &oneline, char ch,CWnd *CurrentWork=NULL); diff --git a/src/TortoiseShell/TortoiseShell.vcproj b/src/TortoiseShell/TortoiseShell.vcproj index 7a3add366..d9245802c 100644 --- a/src/TortoiseShell/TortoiseShell.vcproj +++ b/src/TortoiseShell/TortoiseShell.vcproj @@ -511,6 +511,10 @@ > + + -- 2.11.4.GIT