From b4d0ec65ea6232180a8ef81006845b115f0de3df Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Wed, 29 Oct 2008 10:24:45 +0000 Subject: [PATCH] MGR: Always sort after a row is added or deleted. svn path=/trunk/boinc/; revision=16352 --- checkin_notes | 3 ++- clientgui/BOINCBaseView.cpp | 9 ++++++--- clientgui/BOINCBaseView.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index 01b13b28b8..b46de7f1d2 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8815,10 +8815,11 @@ David 28 Oct 2008 Charlie 29 Oct 2008 - MGR: Fix bug introduced yesterday. + - MGR: Always sort after a row is added or deleted. - Mac: Add new files rr_sim.cpp,.h to XCode project. clientgui/ - BOINCBaseView.cpp + BOINCBaseView.cpp,.h mac_build/ boinc.xcodeproj/ project.pbxproj diff --git a/clientgui/BOINCBaseView.cpp b/clientgui/BOINCBaseView.cpp index 3b6f008cbe..8e4ed4a34d 100644 --- a/clientgui/BOINCBaseView.cpp +++ b/clientgui/BOINCBaseView.cpp @@ -47,6 +47,7 @@ CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook) : m_bForceUpdateSelection = true; m_bIgnoreUIEvents = false; + m_bNeedSort = false; // // Setup View @@ -275,6 +276,7 @@ void CBOINCBaseView::OnListRender(wxTimerEvent& event) { } wxASSERT(GetDocCount() == GetCacheCount()); m_pListPane->SetItemCount(iDocCount); + m_bNeedSort = true; } else { for (iIndex = 0; iIndex < (iCacheCount - iDocCount); iIndex++) { iReturnValue = RemoveCacheElement(); @@ -283,6 +285,7 @@ void CBOINCBaseView::OnListRender(wxTimerEvent& event) { wxASSERT(GetDocCount() == GetCacheCount()); m_pListPane->SetItemCount(iDocCount); m_pListPane->RefreshItems(0, iDocCount - 1); + m_bNeedSort = true; } } } @@ -457,7 +460,6 @@ int CBOINCBaseView::SynchronizeCache() { int iColumnIndex = 0; int iColumnTotal = 0; bool bNeedRefreshData = false; - bool bNeedSort = false; iRowTotal = GetDocCount(); iColumnTotal = m_pListPane->GetColumnCount(); @@ -474,7 +476,7 @@ int CBOINCBaseView::SynchronizeCache() { m_pListPane->RefreshCell(iRowIndex, iColumnIndex); #endif if (iColumnIndex == m_iSortColumn) { - bNeedSort = true; + m_bNeedSort = true; } } } @@ -485,8 +487,9 @@ int CBOINCBaseView::SynchronizeCache() { } } - if (bNeedSort) { + if (m_bNeedSort) { sortData(); // Will mark moved items as needing refresh + m_bNeedSort = false; } return 0; diff --git a/clientgui/BOINCBaseView.h b/clientgui/BOINCBaseView.h index c753642de0..1b782afe99 100644 --- a/clientgui/BOINCBaseView.h +++ b/clientgui/BOINCBaseView.h @@ -177,6 +177,7 @@ protected: bool m_bForceUpdateSelection; bool m_bIgnoreUIEvents; + bool m_bNeedSort; int m_iProgressColumn;