OSDN Git Service

Fix Compare with preview version crash problem at log dialog.
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / LogDlg.cpp
index dd69ad1..e2bb8a1 100644 (file)
@@ -1,12 +1,9 @@
 // TortoiseGit - a Windows shell extension for easy version control\r
-\r
 // Copyright (C) 2003-2008 - TortoiseGit\r
-\r
 // This program is free software; you can redistribute it and/or\r
 // modify it under the terms of the GNU General Public License\r
 // as published by the Free Software Foundation; either version 2\r
 // of the License, or (at your option) any later version.\r
-\r
 // This program is distributed in the hope that it will be useful,\r
 // but WITHOUT ANY WARRANTY; without even the implied warranty of\r
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
@@ -25,7 +22,7 @@
 #include "ProgressDlg.h"\r
 //#include "RepositoryBrowser.h"\r
 //#include "CopyDlg.h"\r
-//#include "StatGraphDlg.h"\r
+#include "StatGraphDlg.h"\r
 #include "Logdlg.h"\r
 #include "MessageBox.h"\r
 #include "Registry.h"\r
 const UINT CLogDlg::m_FindDialogMessage = RegisterWindowMessage(FINDMSGSTRING);\r
 \r
 \r
-\r
-\r
 IMPLEMENT_DYNAMIC(CLogDlg, CResizableStandAloneDialog)\r
 CLogDlg::CLogDlg(CWnd* pParent /*=NULL*/)\r
        : CResizableStandAloneDialog(CLogDlg::IDD, pParent)\r
        , m_logcounter(0)\r
        , m_nSearchIndex(0)\r
        , m_wParam(0)\r
-       , m_nSelectedFilter(LOGFILTER_ALL)\r
        , m_currentChangedArray(NULL)\r
        , m_nSortColumn(0)\r
        , m_bShowedAll(false)\r
@@ -95,9 +89,6 @@ CLogDlg::~CLogDlg()
        \r
     m_CurrentFilteredChangedArray.RemoveAll();\r
        \r
-\r
-\r
-       \r
 }\r
 \r
 void CLogDlg::DoDataExchange(CDataExchange* pDX)\r
@@ -109,7 +100,7 @@ void CLogDlg::DoDataExchange(CDataExchange* pDX)
        DDX_Control(pDX, IDC_SPLITTERTOP, m_wndSplitter1);\r
        DDX_Control(pDX, IDC_SPLITTERBOTTOM, m_wndSplitter2);\r
        DDX_Check(pDX, IDC_CHECK_STOPONCOPY, m_bStrict);\r
-       DDX_Text(pDX, IDC_SEARCHEDIT, m_sFilterText);\r
+       DDX_Text(pDX, IDC_SEARCHEDIT, m_LogList.m_sFilterText);\r
        DDX_Control(pDX, IDC_DATEFROM, m_DateFrom);\r
        DDX_Control(pDX, IDC_DATETO, m_DateTo);\r
        DDX_Control(pDX, IDC_HIDEPATHS, m_cHidePaths);\r
@@ -122,7 +113,7 @@ void CLogDlg::DoDataExchange(CDataExchange* pDX)
 BEGIN_MESSAGE_MAP(CLogDlg, CResizableStandAloneDialog)\r
        ON_REGISTERED_MESSAGE(m_FindDialogMessage, OnFindDialogMessage) \r
        ON_BN_CLICKED(IDC_GETALL, OnBnClickedGetall)\r
-       ON_NOTIFY(NM_DBLCLK, IDC_LOGMSG, OnNMDblclkChangedFileList)\r
+       //ON_NOTIFY(NM_DBLCLK, IDC_LOGMSG, OnNMDblclkChangedFileList)\r
        ON_WM_CONTEXTMENU()\r
        ON_WM_SETCURSOR()\r
        ON_BN_CLICKED(IDHELP, OnBnClickedHelp)\r
@@ -138,10 +129,10 @@ BEGIN_MESSAGE_MAP(CLogDlg, CResizableStandAloneDialog)
        ON_NOTIFY(DTN_DATETIMECHANGE, IDC_DATETO, OnDtnDatetimechangeDateto)\r
        ON_NOTIFY(DTN_DATETIMECHANGE, IDC_DATEFROM, OnDtnDatetimechangeDatefrom)\r
        ON_BN_CLICKED(IDC_NEXTHUNDRED, OnBnClickedNexthundred)\r
-       ON_NOTIFY(NM_CUSTOMDRAW, IDC_LOGMSG, OnNMCustomdrawChangedFileList)\r
-       ON_NOTIFY(LVN_GETDISPINFO, IDC_LOGMSG, OnLvnGetdispinfoChangedFileList)\r
+       //ON_NOTIFY(NM_CUSTOMDRAW, IDC_LOGMSG, OnNMCustomdrawChangedFileList)\r
+       //ON_NOTIFY(LVN_GETDISPINFO, IDC_LOGMSG, OnLvnGetdispinfoChangedFileList)\r
        ON_NOTIFY(LVN_COLUMNCLICK,IDC_LOGLIST   , OnLvnColumnclick)\r
-       ON_NOTIFY(LVN_COLUMNCLICK, IDC_LOGMSG, OnLvnColumnclickChangedFileList)\r
+       //ON_NOTIFY(LVN_COLUMNCLICK, IDC_LOGMSG, OnLvnColumnclickChangedFileList)\r
        ON_BN_CLICKED(IDC_HIDEPATHS, OnBnClickedHidepaths)\r
        \r
        ON_BN_CLICKED(IDC_CHECK_STOPONCOPY, &CLogDlg::OnBnClickedCheckStoponcopy)\r
@@ -219,30 +210,13 @@ BOOL CLogDlg::OnInitDialog()
                m_bShowBugtraqColumn = true;\r
 \r
        //theme.SetWindowTheme(m_LogList.GetSafeHwnd(), L"Explorer", NULL);\r
-       theme.SetWindowTheme(m_ChangedFileListCtrl.GetSafeHwnd(), L"Explorer", NULL);\r
+       //theme.SetWindowTheme(m_ChangedFileListCtrl.GetSafeHwnd(), L"Explorer", NULL);\r
 \r
        // set up the columns\r
        m_LogList.DeleteAllItems();\r
        m_LogList.InsertGitColumn();\r
 \r
-       m_ChangedFileListCtrl.SetExtendedStyle ( LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER );\r
-       m_ChangedFileListCtrl.DeleteAllItems();\r
-       int c = ((CHeaderCtrl*)(m_ChangedFileListCtrl.GetDlgItem(0)))->GetItemCount()-1;\r
-       while (c>=0)\r
-               m_ChangedFileListCtrl.DeleteColumn(c--);\r
-       temp.LoadString(IDS_PROGRS_ACTION);\r
-       m_ChangedFileListCtrl.InsertColumn(this->FILELIST_ACTION, temp);\r
-       temp.LoadString(IDS_LOG_FILE_LINE_ADD);\r
-       m_ChangedFileListCtrl.InsertColumn(this->FILELIST_ADD, temp);\r
-       temp.LoadString(IDS_LOG_FILE_LINE_DEL);\r
-       m_ChangedFileListCtrl.InsertColumn(this->FILELIST_DEL, temp);\r
-       temp.LoadString(IDS_PROGRS_PATH);\r
-       m_ChangedFileListCtrl.InsertColumn(this->FILELIST_PATH, temp);\r
-       \r
-       m_ChangedFileListCtrl.SetRedraw(false);\r
-       CAppUtils::ResizeAllListCtrlCols(&m_ChangedFileListCtrl);\r
-       m_ChangedFileListCtrl.SetRedraw(true);\r
-\r
+       m_ChangedFileListCtrl.Init(SVNSLC_COLEXT | SVNSLC_COLSTATUS |IDS_STATUSLIST_COLADD|IDS_STATUSLIST_COLDEL , _T("LogDlg"),(SVNSLC_POPALL ^ SVNSLC_POPCOMMIT),false);\r
 \r
        GetDlgItem(IDC_LOGLIST)->UpdateData(FALSE);\r
 \r
@@ -363,7 +337,7 @@ BOOL CLogDlg::OnInitDialog()
        // set the choices for the "Show All" button\r
        temp.LoadString(IDS_LOG_SHOWALL);\r
        m_btnShow.AddEntry(temp);\r
-       temp.LoadString(IDS_LOG_SHOWRANGE);\r
+       temp.LoadString(IDS_LOG_SHOW_WHOLE);\r
        m_btnShow.AddEntry(temp);\r
        m_btnShow.SetCurrentEntry((LONG)CRegDWORD(_T("Software\\TortoiseGit\\ShowAllEntry")));\r
 \r
@@ -371,9 +345,10 @@ BOOL CLogDlg::OnInitDialog()
 \r
        // first start a thread to obtain the log messages without\r
        // blocking the dialog\r
-       m_tTo = 0;\r
-       m_tFrom = (DWORD)-1;\r
+       //m_tTo = 0;\r
+       //m_tFrom = (DWORD)-1;\r
 \r
+       m_LogList.m_Path=m_path;\r
        m_LogList.FetchLogAsync(LogCallBack,this);\r
 \r
        GetDlgItem(IDC_LOGLIST)->SetFocus();\r
@@ -401,12 +376,13 @@ void CLogDlg::LogRunStatus(int cur)
 \r
                GetDlgItem(IDC_PROGRESS)->ShowWindow(TRUE);\r
 \r
-               DialogEnableWindow(IDC_GETALL, FALSE);\r
+               //DialogEnableWindow(IDC_GETALL, FALSE);\r
                DialogEnableWindow(IDC_NEXTHUNDRED, FALSE);\r
                DialogEnableWindow(IDC_CHECK_STOPONCOPY, FALSE);\r
                DialogEnableWindow(IDC_INCLUDEMERGE, FALSE);\r
                DialogEnableWindow(IDC_STATBUTTON, FALSE);\r
                DialogEnableWindow(IDC_REFRESH, FALSE);\r
+               DialogEnableWindow(IDC_HIDEPATHS,FALSE);\r
        }\r
 \r
        if( cur == GITLOG_END)\r
@@ -415,13 +391,18 @@ void CLogDlg::LogRunStatus(int cur)
                if (!m_bShowedAll)\r
                        DialogEnableWindow(IDC_NEXTHUNDRED, TRUE);\r
 \r
-               DialogEnableWindow(IDC_CHECK_STOPONCOPY, TRUE);\r
-               DialogEnableWindow(IDC_INCLUDEMERGE, TRUE);\r
+               DialogEnableWindow(IDC_GETALL, TRUE);\r
+               //DialogEnableWindow(IDC_INCLUDEMERGE, TRUE);\r
                DialogEnableWindow(IDC_STATBUTTON, TRUE);\r
                DialogEnableWindow(IDC_REFRESH, TRUE);\r
 \r
-               PostMessage(WM_TIMER, LOGFILTER_TIMER);\r
+//             PostMessage(WM_TIMER, LOGFILTER_TIMER);\r
 \r
+               //CTime time=m_LogList.GetOldestTime();\r
+               CTime begin,end;\r
+               m_LogList.GetTimeRange(begin,end);\r
+               m_DateFrom.SetTime(&begin);\r
+               m_DateTo.SetTime(&end);\r
        }\r
 \r
        m_LogProgress.SetPos(cur);\r
@@ -446,6 +427,8 @@ void CLogDlg::SetDlgTitle(bool bOffline)
        {\r
                if (m_path.IsUrl())\r
                        SetWindowText(m_sTitle + _T(" - ") + m_path.GetUIPathString());\r
+               else if (m_path.IsEmpty())\r
+                       SetWindowText(m_sTitle + _T(" - ") + CString(_T("Whole Project")));\r
                else if (m_path.IsDirectory())\r
                        SetWindowText(m_sTitle + _T(" - ") + m_path.GetWinPathString());\r
                else\r
@@ -492,10 +475,9 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
        m_ChangedFileListCtrl.SetRedraw(FALSE);\r
 //     InterlockedExchange(&m_bNoDispUpdates, TRUE);\r
        m_currentChangedArray = NULL;\r
-       m_ChangedFileListCtrl.SetExtendedStyle ( LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER );\r
+       //m_ChangedFileListCtrl.SetExtendedStyle ( LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER );\r
        m_ChangedFileListCtrl.DeleteAllItems();\r
-       m_ChangedFileListCtrl.SetItemCountEx(0);\r
-\r
+       \r
        // if we're not here to really show a selected revision, just\r
        // get out of here after clearing the views, which is what is intended\r
        // if that flag is not set.\r
@@ -533,16 +515,22 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
                }\r
                GitRev* pLogEntry = reinterpret_cast<GitRev *>(m_LogList.m_arShownList.GetAt(selIndex));\r
 \r
-               // set the log message text\r
-               pMsgView->SetWindowText(_T("Commit:")+pLogEntry->m_CommitHash+_T("\r\n\r\n*")+pLogEntry->m_Subject+_T("\n\n")+pLogEntry->m_Body);\r
-               // turn bug ID's into links if the bugtraq: properties have been set\r
-               // and we can find a match of those in the log message\r
-               m_ProjectProperties.FindBugID(pLogEntry->m_Body, pMsgView);\r
-               CAppUtils::FormatTextInRichEditControl(pMsgView);\r
-               m_currentChangedArray = &(pLogEntry->m_Files);\r
-               if (m_currentChangedArray == NULL)\r
+               if(!pLogEntry->m_IsFull)\r
                {\r
-//                     InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
+                       pMsgView->SetWindowText(_T("load ..."));\r
+               }else\r
+               {\r
+                       // set the log message text\r
+                       pMsgView->SetWindowText(_T("Commit:")+pLogEntry->m_CommitHash+_T("\r\n\r\n*")+pLogEntry->m_Subject+_T("\n\n")+pLogEntry->m_Body);\r
+                       // turn bug ID's into links if the bugtraq: properties have been set\r
+                       // and we can find a match of those in the log message\r
+                       m_ProjectProperties.FindBugID(pLogEntry->m_Body, pMsgView);\r
+                       CAppUtils::FormatTextInRichEditControl(pMsgView);\r
+\r
+                       m_ChangedFileListCtrl.UpdateWithGitPathList(pLogEntry->m_Files);\r
+                       m_ChangedFileListCtrl.m_CurrentVersion=pLogEntry->m_CommitHash;\r
+                       m_ChangedFileListCtrl.Show(SVNSLC_SHOWVERSIONED);\r
+\r
                        m_ChangedFileListCtrl.SetRedraw(TRUE);\r
                        return;\r
                }\r
@@ -576,6 +564,7 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
        \r
        // redraw the views\r
 //     InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
+#if 0\r
        if (m_currentChangedArray)\r
        {\r
                m_ChangedFileListCtrl.SetItemCountEx(m_currentChangedArray->GetCount());\r
@@ -591,6 +580,7 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/)
                m_ChangedFileListCtrl.SetItemCountEx(0);\r
                m_ChangedFileListCtrl.Invalidate();\r
        }\r
+#endif\r
        CAppUtils::ResizeAllListCtrlCols(&m_ChangedFileListCtrl);\r
        // sort according to the settings\r
        if (m_nSortColumnPathList > 0)\r
@@ -608,53 +598,32 @@ void CLogDlg::OnBnClickedGetall()
 \r
 void CLogDlg::GetAll(bool bForceAll /* = false */)\r
 {\r
-#if 0\r
+\r
        // fetch all requested log messages, either the specified range or\r
        // really *all* available log messages.\r
-       UpdateData();\r
+       ///UpdateData();\r
        INT_PTR entry = m_btnShow.GetCurrentEntry();\r
        if (bForceAll)\r
                entry = 0;\r
 \r
        switch (entry)\r
        {\r
-       case 0: // show all\r
-       \r
-               m_endrev = 0;\r
-               m_startrev = m_LogRevision;\r
-               if (m_bStrict)\r
-                       m_bShowedAll = true;\r
-\r
+       case 0: // show all branch;\r
+               m_LogList.m_bAllBranch=true;\r
                break;\r
-       case 1: // show range\r
-               {\r
-\r
-                       // ask for a revision range\r
-                       CRevisionRangeDlg dlg;\r
-                       dlg.SetStartRevision(m_startrev);\r
-                       dlg.SetEndRevision( (m_endrev>=0) ? m_endrev : 0);\r
-                       if (dlg.DoModal()!=IDOK)\r
-                       {\r
-                               return;\r
-                       }\r
-                       m_endrev = dlg.GetEndRevision();\r
-                       m_startrev = dlg.GetStartRevision();\r
-                       if (((m_endrev.IsNumber())&&(m_startrev.IsNumber()))||\r
-                               (m_endrev.IsHead()||m_startrev.IsHead()))\r
-                       {\r
-                               if (((LONG)m_startrev < (LONG)m_endrev)||\r
-                                       (m_endrev.IsHead()))\r
-                               {\r
-                                       git_revnum_t temp = m_startrev;\r
-                                       m_startrev = m_endrev;\r
-                                       m_endrev = temp;\r
-                               }\r
-                       }\r
-                       m_bShowedAll = false;\r
-               }\r
-\r
+       case 1: // show whole project\r
+               m_LogList.m_Path.Reset();\r
+               SetWindowText(m_sTitle + _T(" - "));\r
                break;\r
        }\r
+       //m_LogList.m_bExitThread=TRUE;\r
+       //::WaitForSingleObject(m_LogList.m_LoadingThread->m_hThread,INFINITE);\r
+\r
+       m_LogList.TerminateThread();\r
+       \r
+       m_LogList.Clear();\r
+       m_LogList.FetchLogAsync(LogCallBack,this);\r
+#if 0\r
        m_ChangedFileListCtrl.SetItemCountEx(0);\r
        m_ChangedFileListCtrl.Invalidate();\r
        // We need to create CStoreSelection on the heap or else\r
@@ -700,59 +669,6 @@ void CLogDlg::OnBnClickedRefresh()
 void CLogDlg::Refresh (bool autoGoOnline)\r
 {\r
        m_LogList.Refresh();\r
-\r
-#if 0\r
-       // refreshing means re-downloading the already shown log messages\r
-       UpdateData();\r
-       m_maxChild = 0;\r
-       m_childCounter = 0;\r
-\r
-       if ((m_limit == 0)||(m_bStrict)||(int(m_logEntries.size()-1) > m_limit))\r
-       {\r
-               if (m_logEntries.size() != 0)\r
-               {\r
-                       m_endrev = m_logEntries[m_logEntries.size()-1]->Rev;\r
-               }\r
-       }\r
-       m_startrev = -1;\r
-       m_bCancelled = FALSE;\r
-\r
-       // We need to create CStoreSelection on the heap or else\r
-       // the variable will run out of the scope before the\r
-       // thread ends. Therefore we let the thread delete\r
-       // the instance.\r
-       m_pStoreSelection = new CStoreSelection(this);\r
-       m_ChangedFileListCtrl.SetItemCountEx(0);\r
-       m_ChangedFileListCtrl.Invalidate();\r
-       m_LogList.SetItemCountEx(0);\r
-       m_LogList.Invalidate();\r
-       InterlockedExchange(&m_bNoDispUpdates, TRUE);\r
-       CWnd * pMsgView = GetDlgItem(IDC_MSGVIEW);\r
-       pMsgView->SetWindowText(_T(""));\r
-\r
-       SetSortArrow(&m_LogList, -1, true);\r
-\r
-       m_LogList.DeleteAllItems();\r
-       m_arShownList.RemoveAll();\r
-       m_logEntries.ClearAll();\r
-\r
-    // reset the cached HEAD property & go on-line\r
-\r
-    if (autoGoOnline)\r
-    {\r
-           SetDlgTitle (false);\r
-        logCachePool.GetRepositoryInfo().ResetHeadRevision (m_sUUID, m_sRepositoryRoot);\r
-    }\r
-\r
-       InterlockedExchange(&m_bThreadRunning, TRUE);\r
-       if (AfxBeginThread(LogThreadEntry, this)==NULL)\r
-       {\r
-               InterlockedExchange(&m_bThreadRunning, FALSE);\r
-               CMessageBox::Show(NULL, IDS_ERR_THREADSTARTFAILED, IDS_APPNAME, MB_OK | MB_ICONERROR);\r
-       }\r
-       GetDlgItem(IDC_LOGLIST)->UpdateData(FALSE);\r
-       InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
-#endif\r
 }\r
 \r
 void CLogDlg::OnBnClickedNexthundred()\r
@@ -834,8 +750,16 @@ void CLogDlg::OnCancel()
        temp2.LoadString(IDS_MSGBOX_CANCEL);\r
        if ((temp.Compare(temp2)==0)||(this->IsThreadRunning()))\r
        {\r
-               m_bCancelled = true;\r
-               return;\r
+               //m_bCancelled = true;\r
+               //return;\r
+               if(m_LogList.m_bThreadRunning)\r
+               {\r
+                       //m_LogList.m_bExitThread=true;\r
+                       //WaitForSingleObject(m_LogList.m_LoadingThread->m_hThread,INFINITE);\r
+                       m_LogList.TerminateThread();\r
+               }\r
+\r
+               //m_LogList.TerminateThread();\r
        }\r
        UpdateData();\r
        if (m_bSaveStrict)\r
@@ -1065,7 +989,7 @@ void CLogDlg::OnContextMenu(CWnd* pWnd, CPoint point)
        }\r
        else if (pWnd == &m_ChangedFileListCtrl)\r
        {\r
-               ShowContextMenuForChangedpaths(pWnd, point);\r
+               //ShowContextMenuForChangedpaths(pWnd, point);\r
        }\r
        else if ((selCount == 1)&&(pWnd == GetDlgItem(IDC_MSGVIEW)))\r
        {\r
@@ -1090,12 +1014,12 @@ void CLogDlg::OnContextMenu(CWnd* pWnd, CPoint point)
                        sMenuItemText.LoadString(IDS_SCIEDIT_SELECTALL);\r
                        popup.AppendMenu(MF_STRING | MF_ENABLED, EM_SETSEL, sMenuItemText);\r
 \r
-                       if (selIndex >= 0)\r
-                       {\r
-                               popup.AppendMenu(MF_SEPARATOR);\r
-                               sMenuItemText.LoadString(IDS_LOG_POPUP_EDITLOG);\r
-                               popup.AppendMenu(MF_STRING | MF_ENABLED, CGitLogList::ID_EDITAUTHOR, sMenuItemText);\r
-                       }\r
+                       //if (selIndex >= 0)\r
+                       //{\r
+                       //      popup.AppendMenu(MF_SEPARATOR);\r
+                       //      sMenuItemText.LoadString(IDS_LOG_POPUP_EDITLOG);\r
+                       //      popup.AppendMenu(MF_STRING | MF_ENABLED, CGitLogList::ID_EDITAUTHOR, sMenuItemText);\r
+                       //}\r
 \r
                        int cmd = popup.TrackPopupMenu(TPM_RETURNCMD | TPM_LEFTALIGN | TPM_NONOTIFY, point.x, point.y, this, 0);\r
                        switch (cmd)\r
@@ -1943,30 +1867,30 @@ void CLogDlg::OnEnLinkMsgview(NMHDR *pNMHDR, LRESULT *pResult)
 \r
 void CLogDlg::OnBnClickedStatbutton()\r
 {\r
-#if 0\r
-       if (m_bThreadRunning)\r
+\r
+       if (this->IsThreadRunning())\r
                return;\r
-       if (m_arShownList.IsEmpty())\r
+       if (m_LogList.m_arShownList.IsEmpty())\r
                return;         // nothing is shown, so no statistics.\r
        // the statistics dialog expects the log entries to be sorted by date\r
        SortByColumn(3, false);\r
        CPtrArray shownlist;\r
-       RecalculateShownList(&shownlist);\r
+       m_LogList.RecalculateShownList(&shownlist);\r
        // create arrays which are aware of the current filter\r
        CStringArray m_arAuthorsFiltered;\r
        CDWordArray m_arDatesFiltered;\r
        CDWordArray m_arFileChangesFiltered;\r
        for (INT_PTR i=0; i<shownlist.GetCount(); ++i)\r
        {\r
-               PLOGENTRYDATA pLogEntry = reinterpret_cast<PLOGENTRYDATA>(shownlist.GetAt(i));\r
-               CString strAuthor = pLogEntry->sAuthor;\r
+               GitRev* pLogEntry = reinterpret_cast<GitRev*>(shownlist.GetAt(i));\r
+               CString strAuthor = pLogEntry->m_AuthorName;\r
                if ( strAuthor.IsEmpty() )\r
                {\r
                        strAuthor.LoadString(IDS_STATGRAPH_EMPTYAUTHOR);\r
                }\r
                m_arAuthorsFiltered.Add(strAuthor);\r
-               m_arDatesFiltered.Add(static_cast<DWORD>(pLogEntry->tmDate));\r
-               m_arFileChangesFiltered.Add(pLogEntry->dwFileChanges);\r
+               m_arDatesFiltered.Add(pLogEntry->m_AuthorDate.GetTime());\r
+               m_arFileChangesFiltered.Add(pLogEntry->m_Files.GetCount());\r
        }\r
        CStatGraphDlg dlg;\r
        dlg.m_parAuthors = &m_arAuthorsFiltered;\r
@@ -1977,7 +1901,7 @@ void CLogDlg::OnBnClickedStatbutton()
        // restore the previous sorting\r
        SortByColumn(m_nSortColumn, m_bAscending);\r
        OnTimer(LOGFILTER_TIMER);\r
-#endif\r
+\r
 }\r
 \r
 #if 0\r
@@ -2339,7 +2263,7 @@ LRESULT CLogDlg::OnClickedInfoIcon(WPARAM /*wParam*/, LPARAM lParam)
        CPoint point;\r
        CString temp;\r
        point = CPoint(rect->left, rect->bottom);\r
-#define LOGMENUFLAGS(x) (MF_STRING | MF_ENABLED | (m_nSelectedFilter == x ? MF_CHECKED : MF_UNCHECKED))\r
+#define LOGMENUFLAGS(x) (MF_STRING | MF_ENABLED | (m_LogList.m_nSelectedFilter == x ? MF_CHECKED : MF_UNCHECKED))\r
        CMenu popup;\r
        if (popup.CreatePopupMenu())\r
        {\r
@@ -2378,7 +2302,7 @@ LRESULT CLogDlg::OnClickedInfoIcon(WPARAM /*wParam*/, LPARAM lParam)
                        }\r
                        else\r
                        {\r
-                               m_nSelectedFilter = selection;\r
+                               m_LogList.m_nSelectedFilter = selection;\r
                                SetFilterCueText();\r
                        }\r
                        SetTimer(LOGFILTER_TIMER, 1000, NULL);\r
@@ -2389,42 +2313,28 @@ LRESULT CLogDlg::OnClickedInfoIcon(WPARAM /*wParam*/, LPARAM lParam)
 \r
 LRESULT CLogDlg::OnClickedCancelFilter(WPARAM /*wParam*/, LPARAM /*lParam*/)\r
 {\r
-#if 0\r
+\r
        KillTimer(LOGFILTER_TIMER);\r
 \r
-       m_sFilterText.Empty();\r
+       m_LogList.m_sFilterText.Empty();\r
        UpdateData(FALSE);\r
        theApp.DoWaitCursor(1);\r
        CStoreSelection storeselection(this);\r
        FillLogMessageCtrl(false);\r
-       InterlockedExchange(&m_bNoDispUpdates, TRUE);\r
-       m_arShownList.RemoveAll();\r
 \r
-       // reset the time filter too\r
-       m_timFrom = (__time64_t(m_tFrom));\r
-       m_timTo = (__time64_t(m_tTo));\r
-       m_DateFrom.SetTime(&m_timFrom);\r
-       m_DateTo.SetTime(&m_timTo);\r
-       m_DateFrom.SetRange(&m_timFrom, &m_timTo);\r
-       m_DateTo.SetRange(&m_timFrom, &m_timTo);\r
+       m_LogList.RemoveFilter();\r
+\r
+       CTime begin,end;\r
+       m_LogList.GetTimeRange(begin,end);\r
+       m_DateFrom.SetTime(&begin);\r
+       m_DateTo.SetTime(&end);\r
 \r
-       for (DWORD i=0; i<m_logEntries.size(); ++i)\r
-       {\r
-               m_arShownList.Add(m_logEntries[i]);\r
-       }\r
-       InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
-       m_LogList.DeleteAllItems();\r
-       m_LogList.SetItemCountEx(ShownCountWithStopped());\r
-       m_LogList.RedrawItems(0, ShownCountWithStopped());\r
-       m_LogList.SetRedraw(false);\r
-       ResizeAllListCtrlCols();\r
-       m_LogList.SetRedraw(true);\r
        theApp.DoWaitCursor(-1);\r
        GetDlgItem(IDC_SEARCHEDIT)->ShowWindow(SW_HIDE);\r
        GetDlgItem(IDC_SEARCHEDIT)->ShowWindow(SW_SHOW);\r
        GetDlgItem(IDC_SEARCHEDIT)->SetFocus();\r
        UpdateLogInfoLabel();\r
-#endif\r
+\r
        return 0L;      \r
 }\r
 \r
@@ -2432,7 +2342,7 @@ LRESULT CLogDlg::OnClickedCancelFilter(WPARAM /*wParam*/, LPARAM /*lParam*/)
 void CLogDlg::SetFilterCueText()\r
 {\r
        CString temp;\r
-       switch (m_nSelectedFilter)\r
+       switch (m_LogList.m_nSelectedFilter)\r
        {\r
        case LOGFILTER_ALL:\r
                temp.LoadString(IDS_LOG_FILTER_ALL);\r
@@ -2454,371 +2364,15 @@ void CLogDlg::SetFilterCueText()
        temp = _T("   ")+temp;\r
        m_cFilter.SetCueBanner(temp);\r
 }\r
-#if 0\r
-void CLogDlg::OnLvnGetdispinfoLoglist(NMHDR *pNMHDR, LRESULT *pResult)\r
-{\r
-       NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);\r
-\r
-       // Create a pointer to the item\r
-       LV_ITEM* pItem = &(pDispInfo)->item;\r
-\r
-       // Do the list need text information?\r
-       if (!(pItem->mask & LVIF_TEXT))\r
-               return;\r
-\r
-       // By default, clear text buffer.\r
-       lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
-\r
-       bool bOutOfRange = pItem->iItem >= ShownCountWithStopped();\r
-       \r
-       *pResult = 0;\r
-       if (m_bNoDispUpdates || m_bThreadRunning || bOutOfRange)\r
-               return;\r
-\r
-       // Which item number?\r
-       int itemid = pItem->iItem;\r
-       GitRev * pLogEntry = NULL;\r
-       if (itemid < m_arShownList.GetCount())\r
-               pLogEntry = reinterpret_cast<GitRev*>(m_arShownList.GetAt(pItem->iItem));\r
-    \r
-       // Which column?\r
-       switch (pItem->iSubItem)\r
-       {\r
-       case this->LOGLIST_GRAPH:       //Graphic\r
-               if (pLogEntry)\r
-               {\r
-               }\r
-               break;\r
-       case this->LOGLIST_ACTION: //action -- no text in the column\r
-               break;\r
-       case this->LOGLIST_MESSAGE: //Message\r
-               if (pLogEntry)\r
-                       lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_Subject, pItem->cchTextMax);\r
-               break;\r
-       case this->LOGLIST_AUTHOR: //Author\r
-               if (pLogEntry)\r
-                       lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_AuthorName, pItem->cchTextMax);\r
-               break;\r
-       case this->LOGLIST_DATE: //Date\r
-               if (pLogEntry)\r
-                       lstrcpyn(pItem->pszText, (LPCTSTR)pLogEntry->m_AuthorDate.Format(_T("%Y-%m-%d %H:%M")), pItem->cchTextMax);\r
-               break;\r
-               \r
-       case 5:\r
-\r
-               break;\r
-       default:\r
-               ASSERT(false);\r
-       }\r
-}\r
-#endif\r
-void CLogDlg::OnLvnGetdispinfoChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)\r
-{\r
-\r
-#if 0\r
-       NMLVDISPINFO *pDispInfo = reinterpret_cast<NMLVDISPINFO*>(pNMHDR);\r
-\r
-       //Create a pointer to the item\r
-       LV_ITEM* pItem= &(pDispInfo)->item;\r
-\r
-       *pResult = 0;\r
-       if ((m_bNoDispUpdates)||(m_bThreadRunning))\r
-       {\r
-               if (pItem->mask & LVIF_TEXT)\r
-                       lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
-               return;\r
-       }\r
-       if ((m_currentChangedArray!=NULL)&&(pItem->iItem >= m_currentChangedArray->GetCount()))\r
-       {\r
-               if (pItem->mask & LVIF_TEXT)\r
-                       lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
-               return;\r
-       }\r
-       if ((m_currentChangedArray==NULL)&&(pItem->iItem >= m_currentChangedPathList.GetCount()))\r
-       {\r
-               if (pItem->mask & LVIF_TEXT)\r
-                       lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
-               return;\r
-       }\r
-       CTGitPath lcpath = NULL;\r
-       if (m_currentChangedArray)\r
-               lcpath = (*m_currentChangedArray)[pItem->iItem];\r
-       //Does the list need text information?\r
-       if (pItem->mask & LVIF_TEXT)\r
-       {\r
-               //Which column?\r
-               switch (pItem->iSubItem)\r
-               {\r
-               case this->FILELIST_ACTION:     //Action\r
-#if 0\r
-                       if (lcpath)\r
-                               lstrcpyn(pItem->pszText, (LPCTSTR)lcpath->GetAction(), pItem->cchTextMax);\r
-                       else\r
-                               lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);                            \r
-#endif\r
-                       lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.GetActionName(), pItem->cchTextMax);\r
-\r
-                       break;\r
-\r
-               case this->FILELIST_ADD: //add\r
-#if 0\r
-                       if (lcpath)\r
-                               lstrcpyn(pItem->pszText, (LPCTSTR)lcpath->sPath, pItem->cchTextMax);\r
-                       else\r
-                               lstrcpyn(pItem->pszText, (LPCTSTR)m_currentChangedPathList[pItem->iItem].GetGitPathString(), pItem->cchTextMax);\r
-#endif\r
-                       lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.m_StatAdd, pItem->cchTextMax);\r
-                       break;\r
-\r
-               case this->FILELIST_DEL: //del\r
-#if 0\r
-                       if (lcpath)\r
-                               lstrcpyn(pItem->pszText, (LPCTSTR)lcpath->sCopyFromPath, pItem->cchTextMax);\r
-                       else\r
-                               lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
-#endif\r
-                       lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.m_StatDel, pItem->cchTextMax);\r
-                       break;\r
-               case this->FILELIST_PATH: //path\r
-#if 0\r
-                       if ((lcpath==NULL)||(lcpath->sCopyFromPath.IsEmpty()))\r
-                               lstrcpyn(pItem->pszText, _T(""), pItem->cchTextMax);\r
-                       else\r
-                               _stprintf_s(pItem->pszText, pItem->cchTextMax, _T("%ld"), lcpath->lCopyFromRev);\r
-#endif\r
-                       lstrcpyn(pItem->pszText, (LPCTSTR)lcpath.GetGitPathString(), pItem->cchTextMax);\r
-                       break;\r
-               }\r
-       }\r
-#endif\r
-       *pResult = 0;\r
-}\r
-\r
-void CLogDlg::OnEnChangeSearchedit()\r
-{\r
-#if 0\r
-       UpdateData();\r
-       if (m_sFilterText.IsEmpty())\r
-       {\r
-               CStoreSelection storeselection(this);\r
-               // clear the filter, i.e. make all entries appear\r
-               theApp.DoWaitCursor(1);\r
-               KillTimer(LOGFILTER_TIMER);\r
-               FillLogMessageCtrl(false);\r
-               InterlockedExchange(&m_bNoDispUpdates, TRUE);\r
-               m_arShownList.RemoveAll();\r
-               for (DWORD i=0; i<m_logEntries.size(); ++i)\r
-               {\r
-                       if (IsEntryInDateRange(i))\r
-                               m_arShownList.Add(m_logEntries[i]);\r
-               }\r
-               InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
-               m_LogList.DeleteAllItems();\r
-               m_LogList.SetItemCountEx(ShownCountWithStopped());\r
-               m_LogList.RedrawItems(0, ShownCountWithStopped());\r
-               m_LogList.SetRedraw(false);\r
-               ResizeAllListCtrlCols();\r
-               m_LogList.SetRedraw(true);\r
-               theApp.DoWaitCursor(-1);\r
-               GetDlgItem(IDC_SEARCHEDIT)->ShowWindow(SW_HIDE);\r
-               GetDlgItem(IDC_SEARCHEDIT)->ShowWindow(SW_SHOW);\r
-               GetDlgItem(IDC_SEARCHEDIT)->SetFocus();\r
-               DialogEnableWindow(IDC_STATBUTTON, !(((m_bThreadRunning)||(m_arShownList.IsEmpty()))));\r
-               return;\r
-       }\r
-       if (Validate(m_sFilterText))\r
-               SetTimer(LOGFILTER_TIMER, 1000, NULL);\r
-       else\r
-               KillTimer(LOGFILTER_TIMER);\r
-#endif\r
-}\r
-\r
-bool CLogDlg::ValidateRegexp(LPCTSTR regexp_str, tr1::wregex& pat, bool bMatchCase /* = false */)\r
-{\r
-       try\r
-       {\r
-               tr1::regex_constants::syntax_option_type type = tr1::regex_constants::ECMAScript;\r
-               if (!bMatchCase)\r
-                       type |= tr1::regex_constants::icase;\r
-               pat = tr1::wregex(regexp_str, type);\r
-               return true;\r
-       }\r
-       catch (exception) {}\r
-       return false;\r
-}\r
 \r
 bool CLogDlg::Validate(LPCTSTR string)\r
 {\r
        if (!m_bFilterWithRegex)\r
                return true;\r
        tr1::wregex pat;\r
-       return ValidateRegexp(string, pat, false);\r
+       return m_LogList.ValidateRegexp(string, pat, false);\r
 }\r
 \r
-void CLogDlg::RecalculateShownList(CPtrArray * pShownlist)\r
-{\r
-#if 0\r
-       pShownlist->RemoveAll();\r
-       tr1::wregex pat;//(_T("Remove"), tr1::regex_constants::icase);\r
-       bool bRegex = false;\r
-       if (m_bFilterWithRegex)\r
-               bRegex = ValidateRegexp(m_sFilterText, pat, false);\r
-\r
-       tr1::regex_constants::match_flag_type flags = tr1::regex_constants::match_any;\r
-       CString sRev;\r
-       for (DWORD i=0; i<m_logEntries.size(); ++i)\r
-       {\r
-               if ((bRegex)&&(m_bFilterWithRegex))\r
-               {\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_BUGID))\r
-                       {\r
-                               ATLTRACE(_T("bugID = \"%s\"\n"), (LPCTSTR)m_logEntries[i]->sBugIDs);\r
-                               if (regex_search(wstring((LPCTSTR)m_logEntries[i]->sBugIDs), pat, flags)&&IsEntryInDateRange(i))\r
-                               {\r
-                                       pShownlist->Add(m_logEntries[i]);\r
-                                       continue;\r
-                               }\r
-                       }\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_MESSAGES))\r
-                       {\r
-                               ATLTRACE(_T("messge = \"%s\"\n"), (LPCTSTR)m_logEntries[i]->sMessage);\r
-                               if (regex_search(wstring((LPCTSTR)m_logEntries[i]->sMessage), pat, flags)&&IsEntryInDateRange(i))\r
-                               {\r
-                                       pShownlist->Add(m_logEntries[i]);\r
-                                       continue;\r
-                               }\r
-                       }\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_PATHS))\r
-                       {\r
-                               LogChangedPathArray * cpatharray = m_logEntries[i]->pArChangedPaths;\r
-\r
-                               bool bGoing = true;\r
-                               for (INT_PTR cpPathIndex = 0; cpPathIndex<cpatharray->GetCount() && bGoing; ++cpPathIndex)\r
-                               {\r
-                                       LogChangedPath * cpath = cpatharray->GetAt(cpPathIndex);\r
-                                       if (regex_search(wstring((LPCTSTR)cpath->sCopyFromPath), pat, flags)&&IsEntryInDateRange(i))\r
-                                       {\r
-                                               pShownlist->Add(m_logEntries[i]);\r
-                                               bGoing = false;\r
-                                               continue;\r
-                                       }\r
-                                       if (regex_search(wstring((LPCTSTR)cpath->sPath), pat, flags)&&IsEntryInDateRange(i))\r
-                                       {\r
-                                               pShownlist->Add(m_logEntries[i]);\r
-                                               bGoing = false;\r
-                                               continue;\r
-                                       }\r
-                                       if (regex_search(wstring((LPCTSTR)cpath->GetAction()), pat, flags)&&IsEntryInDateRange(i))\r
-                                       {\r
-                                               pShownlist->Add(m_logEntries[i]);\r
-                                               bGoing = false;\r
-                                               continue;\r
-                                       }\r
-                               }\r
-                               if (!bGoing)\r
-                                       continue;\r
-                       }\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_AUTHORS))\r
-                       {\r
-                               if (regex_search(wstring((LPCTSTR)m_logEntries[i]->sAuthor), pat, flags)&&IsEntryInDateRange(i))\r
-                               {\r
-                                       pShownlist->Add(m_logEntries[i]);\r
-                                       continue;\r
-                               }\r
-                       }\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_REVS))\r
-                       {\r
-                               sRev.Format(_T("%ld"), m_logEntries[i]->Rev);\r
-                               if (regex_search(wstring((LPCTSTR)sRev), pat, flags)&&IsEntryInDateRange(i))\r
-                               {\r
-                                       pShownlist->Add(m_logEntries[i]);\r
-                                       continue;\r
-                               }\r
-                       }\r
-               } // if (bRegex)\r
-               else\r
-               {\r
-                       CString find = m_sFilterText;\r
-                       find.MakeLower();\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_BUGID))\r
-                       {\r
-                               CString sBugIDs = m_logEntries[i]->sBugIDs;\r
-\r
-                               sBugIDs = sBugIDs.MakeLower();\r
-                               if ((sBugIDs.Find(find) >= 0)&&(IsEntryInDateRange(i)))\r
-                               {\r
-                                       pShownlist->Add(m_logEntries[i]);\r
-                                       continue;\r
-                               }\r
-                       }\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_MESSAGES))\r
-                       {\r
-                               CString msg = m_logEntries[i]->sMessage;\r
-\r
-                               msg = msg.MakeLower();\r
-                               if ((msg.Find(find) >= 0)&&(IsEntryInDateRange(i)))\r
-                               {\r
-                                       pShownlist->Add(m_logEntries[i]);\r
-                                       continue;\r
-                               }\r
-                       }\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_PATHS))\r
-                       {\r
-                               LogChangedPathArray * cpatharray = m_logEntries[i]->pArChangedPaths;\r
-\r
-                               bool bGoing = true;\r
-                               for (INT_PTR cpPathIndex = 0; cpPathIndex<cpatharray->GetCount() && bGoing; ++cpPathIndex)\r
-                               {\r
-                                       LogChangedPath * cpath = cpatharray->GetAt(cpPathIndex);\r
-                                       CString path = cpath->sCopyFromPath;\r
-                                       path.MakeLower();\r
-                                       if ((path.Find(find)>=0)&&(IsEntryInDateRange(i)))\r
-                                       {\r
-                                               pShownlist->Add(m_logEntries[i]);\r
-                                               bGoing = false;\r
-                                               continue;\r
-                                       }\r
-                                       path = cpath->sPath;\r
-                                       path.MakeLower();\r
-                                       if ((path.Find(find)>=0)&&(IsEntryInDateRange(i)))\r
-                                       {\r
-                                               pShownlist->Add(m_logEntries[i]);\r
-                                               bGoing = false;\r
-                                               continue;\r
-                                       }\r
-                                       path = cpath->GetAction();\r
-                                       path.MakeLower();\r
-                                       if ((path.Find(find)>=0)&&(IsEntryInDateRange(i)))\r
-                                       {\r
-                                               pShownlist->Add(m_logEntries[i]);\r
-                                               bGoing = false;\r
-                                               continue;\r
-                                       }\r
-                               }\r
-                       }\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_AUTHORS))\r
-                       {\r
-                               CString msg = m_logEntries[i]->sAuthor;\r
-                               msg = msg.MakeLower();\r
-                               if ((msg.Find(find) >= 0)&&(IsEntryInDateRange(i)))\r
-                               {\r
-                                       pShownlist->Add(m_logEntries[i]);\r
-                                       continue;\r
-                               }\r
-                       }\r
-                       if ((m_nSelectedFilter == LOGFILTER_ALL)||(m_nSelectedFilter == LOGFILTER_REVS))\r
-                       {\r
-                               sRev.Format(_T("%ld"), m_logEntries[i]->Rev);\r
-                               if ((sRev.Find(find) >= 0)&&(IsEntryInDateRange(i)))\r
-                               {\r
-                                       pShownlist->Add(m_logEntries[i]);\r
-                                       continue;\r
-                               }\r
-                       }\r
-               } // else (from if (bRegex))    \r
-       } // for (DWORD i=0; i<m_logEntries.size(); ++i) \r
-#endif\r
-}\r
 \r
 void CLogDlg::OnTimer(UINT_PTR nIDEvent)\r
 {\r
@@ -2833,7 +2387,7 @@ void CLogDlg::OnTimer(UINT_PTR nIDEvent)
                CWnd * focusWnd = GetFocus();\r
                bool bSetFocusToFilterControl = ((focusWnd != GetDlgItem(IDC_DATEFROM))&&(focusWnd != GetDlgItem(IDC_DATETO))\r
                        && (focusWnd != GetDlgItem(IDC_LOGLIST)));\r
-               if (m_sFilterText.IsEmpty())\r
+               if (m_LogList.m_sFilterText.IsEmpty())\r
                {\r
                        DialogEnableWindow(IDC_STATBUTTON, !(((this->IsThreadRunning())||(m_LogList.m_arShownList.IsEmpty()))));\r
                        // do not return here!\r
@@ -2847,23 +2401,13 @@ void CLogDlg::OnTimer(UINT_PTR nIDEvent)
                FillLogMessageCtrl(false);\r
 \r
                // now start filter the log list\r
-//             InterlockedExchange(&m_bNoDispUpdates, TRUE);\r
-//             RecalculateShownList(&m_LogList.m_arShownList);\r
-//             InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
+               m_LogList.StartFilter();\r
 \r
-\r
-//             m_LogList.DeleteAllItems();\r
-//             m_LogList.SetItemCountEx(m_LogList.ShownCountWithStopped());\r
-//             m_LogList.RedrawItems(0, m_LogList.ShownCountWithStopped());\r
-//             m_LogList.SetRedraw(false);\r
-//             m_LogList.ResizeAllListCtrlCols();\r
-//             m_LogList.SetRedraw(true);\r
-//             m_LogList.Invalidate();\r
-//             if ( m_LogList.GetItemCount()==1 )\r
-//             {\r
-//                     m_LogList.SetSelectionMark(0);\r
-//                     m_LogList.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);\r
-//             }\r
+               if ( m_LogList.GetItemCount()==1 )\r
+               {\r
+                       m_LogList.SetSelectionMark(0);\r
+                       m_LogList.SetItemState(0, LVIS_SELECTED, LVIS_SELECTED);\r
+               }\r
                theApp.DoWaitCursor(-1);\r
                GetDlgItem(IDC_SEARCHEDIT)->ShowWindow(SW_HIDE);\r
                GetDlgItem(IDC_SEARCHEDIT)->ShowWindow(SW_SHOW);\r
@@ -2882,9 +2426,9 @@ void CLogDlg::OnDtnDatetimechangeDateto(NMHDR * /*pNMHDR*/, LRESULT *pResult)
        try\r
        {\r
                CTime time(_time.GetYear(), _time.GetMonth(), _time.GetDay(), 23, 59, 59);\r
-               if (time.GetTime() != m_tTo)\r
+               if (time.GetTime() != m_LogList.m_To.GetTime())\r
                {\r
-                       m_tTo = (DWORD)time.GetTime();\r
+                       m_LogList.m_To = (DWORD)time.GetTime();\r
                        SetTimer(LOGFILTER_TIMER, 10, NULL);\r
                }\r
        }\r
@@ -2902,9 +2446,9 @@ void CLogDlg::OnDtnDatetimechangeDatefrom(NMHDR * /*pNMHDR*/, LRESULT *pResult)
        try\r
        {\r
                CTime time(_time.GetYear(), _time.GetMonth(), _time.GetDay(), 0, 0, 0);\r
-               if (time.GetTime() != m_tFrom)\r
+               if (time.GetTime() != m_LogList.m_From.GetTime())\r
                {\r
-                       m_tFrom = (DWORD)time.GetTime();\r
+                       m_LogList.m_From = (DWORD)time.GetTime();\r
                        SetTimer(LOGFILTER_TIMER, 10, NULL);\r
                }\r
        }\r
@@ -2915,16 +2459,7 @@ void CLogDlg::OnDtnDatetimechangeDatefrom(NMHDR * /*pNMHDR*/, LRESULT *pResult)
        *pResult = 0;\r
 }\r
 \r
-BOOL CLogDlg::IsEntryInDateRange(int i)\r
-{\r
-#if 0\r
-       __time64_t time = m_logEntries[i]->tmDate;\r
-       if ((time >= m_tFrom)&&(time <= m_tTo))\r
-               return TRUE;\r
-#endif\r
-       return FALSE;\r
 \r
-}\r
 \r
 CTGitPathList CLogDlg::GetChangedPathsFromSelectedRevisions(bool bRelativePaths /* = false */, bool bUseFilter /* = true */)\r
 {\r
@@ -3094,6 +2629,7 @@ void CLogDlg::SetSortArrow(CListCtrl * control, int nColumn, bool bAscending)
 }\r
 void CLogDlg::OnLvnColumnclickChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)\r
 {\r
+#if 0\r
        if (this->IsThreadRunning())\r
                return;         //no sorting while the arrays are filled\r
        if (m_currentChangedArray == NULL)\r
@@ -3107,6 +2643,7 @@ void CLogDlg::OnLvnColumnclickChangedFileList(NMHDR *pNMHDR, LRESULT *pResult)
        SetSortArrow(&m_ChangedFileListCtrl, m_nSortColumnPathList, m_bAscendingPathList);\r
        m_ChangedFileListCtrl.Invalidate();\r
        *pResult = 0;\r
+#endif\r
 }\r
 \r
 int CLogDlg::m_nSortColumnPathList = 0;\r
@@ -3271,7 +2808,7 @@ void CLogDlg::UpdateLogInfoLabel()
 \r
        git_revnum_t rev1 ;\r
        git_revnum_t rev2 ;\r
-       long selectedrevs ;\r
+       long selectedrevs = 0;\r
        int count =m_LogList.m_arShownList.GetCount();\r
        if (count)\r
        {\r
@@ -3287,6 +2824,7 @@ void CLogDlg::UpdateLogInfoLabel()
        UpdateData(FALSE);\r
 }\r
 \r
+#if 0\r
 void CLogDlg::ShowContextMenuForChangedpaths(CWnd* /*pWnd*/, CPoint point)\r
 {\r
 \r
@@ -3822,6 +3360,7 @@ void CLogDlg::ShowContextMenuForChangedpaths(CWnd* /*pWnd*/, CPoint point)
 \r
        } // if (popup.CreatePopupMenu())\r
 }\r
+#endif\r
 \r
 void CLogDlg::OnDtnDropdownDatefrom(NMHDR * /*pNMHDR*/, LRESULT *pResult)\r
 {\r
@@ -3913,3 +3452,43 @@ CString CLogDlg::GetAbsoluteUrlFromRelativeUrl(const CString& url)
 }\r
 \r
 \r
+void CLogDlg::OnEnChangeSearchedit()\r
+{\r
+       UpdateData();\r
+       if (m_LogList.m_sFilterText.IsEmpty())\r
+       {\r
+               CStoreSelection storeselection(this);\r
+               // clear the filter, i.e. make all entries appear\r
+               theApp.DoWaitCursor(1);\r
+               KillTimer(LOGFILTER_TIMER);\r
+               FillLogMessageCtrl(false);\r
+               m_LogList.StartFilter();\r
+#if 0\r
+               InterlockedExchange(&m_bNoDispUpdates, TRUE);\r
+               m_arShownList.RemoveAll();\r
+               for (DWORD i=0; i<m_logEntries.size(); ++i)\r
+               {\r
+                       if (IsEntryInDateRange(i))\r
+                               m_arShownList.Add(m_logEntries[i]);\r
+               }\r
+               InterlockedExchange(&m_bNoDispUpdates, FALSE);\r
+               m_LogList.DeleteAllItems();\r
+               m_LogList.SetItemCountEx(ShownCountWithStopped());\r
+               m_LogList.RedrawItems(0, ShownCountWithStopped());\r
+               m_LogList.SetRedraw(false);\r
+               ResizeAllListCtrlCols();\r
+               m_LogList.SetRedraw(true);\r
+#endif\r
+               theApp.DoWaitCursor(-1);\r
+               GetDlgItem(IDC_SEARCHEDIT)->ShowWindow(SW_HIDE);\r
+               GetDlgItem(IDC_SEARCHEDIT)->ShowWindow(SW_SHOW);\r
+               GetDlgItem(IDC_SEARCHEDIT)->SetFocus();\r
+               DialogEnableWindow(IDC_STATBUTTON, !(((this->IsThreadRunning())||(m_LogList.m_arShownList.IsEmpty()))));\r
+               return;\r
+       }\r
+       if (Validate(m_LogList.m_sFilterText))\r
+               SetTimer(LOGFILTER_TIMER, 1000, NULL);\r
+       else\r
+               KillTimer(LOGFILTER_TIMER);\r
+\r
+}
\ No newline at end of file