OSDN Git Service

Update first commit can't show when launch log dialog
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / GitLogListBase.cpp
index 0839948..f4e2314 100644 (file)
@@ -361,9 +361,6 @@ void CGitLogListBase::FillBackGround(HDC hdc, int Index,CRect &rect)
                                brush = ::CreateSolidBrush(RGB(156,156,156));\r
                        else if(pLogEntry->m_Action&CTGitPath::LOGACTIONS_REBASE_EDIT)\r
                                brush = ::CreateSolidBrush(RGB(200,200,128));\r
-\r
-                       if(pLogEntry->m_CommitHash == GIT_REV_ZERO)\r
-                               brush = ::CreateSolidBrush(RGB(200,200,128));\r
                }\r
 \r
                if (brush != NULL)\r
@@ -404,8 +401,6 @@ void CGitLogListBase::FillBackGround(HDC hdc, int Index,CRect &rect)
                                brush = ::CreateSolidBrush(RGB(156,156,156));\r
                        else if(pLogEntry->m_Action&CTGitPath::LOGACTIONS_REBASE_EDIT)\r
                                brush = ::CreateSolidBrush(RGB(200,200,128));\r
-                       else if(pLogEntry->m_CommitHash == GIT_REV_ZERO)\r
-                               brush = ::CreateSolidBrush(RGB(200,200,128));\r
                        else\r
                                brush = ::CreateSolidBrush(::GetSysColor(COLOR_WINDOW));\r
                }\r
@@ -938,8 +933,6 @@ void CGitLogListBase::OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult)
                                                pLVCD->clrTextBk = RGB(156,156,156);\r
                                        else if(data->m_Action&CTGitPath::LOGACTIONS_REBASE_EDIT)\r
                                                pLVCD->clrTextBk  = RGB(200,200,128);\r
-                                       else if(data->m_CommitHash == GIT_REV_ZERO)\r
-                                               pLVCD->clrTextBk  = RGB(200,200,128);\r
                                        else\r
                                                pLVCD->clrTextBk  = ::GetSysColor(COLOR_WINDOW);\r
 \r
@@ -960,8 +953,8 @@ void CGitLogListBase::OnNMCustomdrawLoglist(NMHDR *pNMHDR, LRESULT *pResult)
 //                                     \r
                                        if (data->m_CommitHash == GIT_REV_ZERO)\r
                                        {\r
-                                               //crText = GetSysColor(COLOR_GRAYTEXT);\r
-                                               SelectObject(pLVCD->nmcd.hdc, m_boldFont);\r
+                                               //crText = GetSysColor(RGB(200,200,0));\r
+                                               //SelectObject(pLVCD->nmcd.hdc, m_boldFont);\r
                                                // We changed the font, so we're returning CDRF_NEWFONT. This\r
                                                // tells the control to recalculate the extent of the text.\r
                                                *pResult = CDRF_NOTIFYSUBITEMDRAW | CDRF_NEWFONT;\r
@@ -1158,7 +1151,7 @@ void CGitLogListBase::OnLvnGetdispinfoLoglist(NMHDR *pNMHDR, LRESULT *pResult)
                        lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_AuthorName, pItem->cchTextMax);\r
                break;\r
        case this->LOGLIST_DATE: //Date\r
-               if (pLogEntry)\r
+               if (pLogEntry && pLogEntry->m_CommitHash != GIT_REV_ZERO)\r
                        lstrcpyn(pItem->pszText,\r
                                CAppUtils::FormatDateAndTime( pLogEntry->m_AuthorDate, m_DateFormat, true, m_bRelativeTimes ), \r
                                pItem->cchTextMax);\r
@@ -1772,13 +1765,17 @@ int CGitLogListBase::FillGitShortLog()
        if(m_bShowWC)\r
                this->m_logEntries.insert(m_logEntries.begin(),this->m_wcRev);\r
 \r
-       this->m_logEntries.FetchShortLog(path,m_StartRef,-1,mask);\r
+       this->m_logEntries.FetchShortLog(path,m_StartRef,-1,mask,m_bShowWC?1:0);\r
 \r
        //this->m_logEntries.ParserFromLog();\r
        if(IsInWorkingThread())\r
+       {\r
                PostMessage(LVM_SETITEMCOUNT, (WPARAM) this->m_logEntries.size(),(LPARAM) LVSICF_NOINVALIDATEALL);\r
+       }\r
        else\r
+       {\r
                SetItemCountEx(this->m_logEntries.size());\r
+       }\r
 \r
        this->m_arShownList.RemoveAll();\r
 \r
@@ -2089,7 +2086,9 @@ UINT CGitLogListBase::LogThread()
                        m_logEntries[i].m_Action =0;\r
                        for(int j=0;j< m_logEntries[i].m_Files.GetCount();j++)\r
                                m_logEntries[i].m_Action |= m_logEntries[i].m_Files[j].m_Action;\r
-\r
+                       \r
+                       m_logEntries[i].m_Body.Format(_T("%d files changed"),m_logEntries[i].m_Files.GetCount());\r
+                       ::PostMessage(m_hWnd,MSG_LOADED,(WPARAM)0,0);\r
                        continue;\r
                }\r
 \r
@@ -2108,6 +2107,8 @@ UINT CGitLogListBase::LogThread()
                        InterlockedExchange(&m_logEntries[i].m_IsFull,TRUE);\r
                        update++;\r
                }\r
+               ::PostMessage(m_hWnd,MSG_LOADED,(WPARAM) i, 0);\r
+\r
                if(start<0)\r
                        break;\r
                if(start>=m_logEntries.m_RawlogData.size())\r
@@ -2116,7 +2117,6 @@ UINT CGitLogListBase::LogThread()
                int percent=i*30/m_logEntries.size() + GITLOG_START+1;\r
 \r
                ::PostMessage(GetParent()->m_hWnd,MSG_LOAD_PERCENTAGE,(WPARAM) percent, 0);\r
-               ::PostMessage(m_hWnd,MSG_LOADED,(WPARAM) i, 0);\r
 \r
                if(this->m_bExitThread)\r
                {       \r
@@ -2179,7 +2179,8 @@ void CGitLogListBase::Refresh()
                if(ret == WAIT_TIMEOUT)\r
                        TerminateThread();\r
        }\r
-\r
+       \r
+       this->SetItemCountEx(0);\r
        this->Clear();\r
 \r
        //Update branch and Tag info\r
@@ -2187,7 +2188,7 @@ void CGitLogListBase::Refresh()
        //Assume Thread have exited\r
        //if(!m_bThreadRunning)\r
        {\r
-               this->SetItemCountEx(0);\r
+               \r
                m_logEntries.clear();\r
                m_bExitThread=FALSE;\r
                InterlockedExchange(&m_bThreadRunning, TRUE);\r
@@ -2505,6 +2506,11 @@ LRESULT CGitLogListBase::OnLoad(WPARAM wParam,LPARAM lParam)
        int i=(int)wParam;\r
        this->GetItemRect(i,&rect,LVIR_BOUNDS);\r
        this->InvalidateRect(rect);\r
+\r
+       if(this->GetItemState(i,LVIF_STATE) & LVIS_SELECTED)\r
+       {\r
+               int i=0;\r
+       }\r
        return 0;\r
 }\r
 \r