diff --git a/checkin_notes b/checkin_notes index 02ee6b3f6a..9122940931 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1796,3 +1796,10 @@ David 10 Mar 2010 time_stats.cpp app_control.cpp +Charlie 10 Mar 2010 + - MGR: Improve performance when reducing number of rows in lists (as + when selecting "Show active tasks") by calling ClearSelections() + and SetItemCount() instead of repeatedly calling DeleteItem(). + + clientgui/ + BOINCBaseView.cpp diff --git a/clientgui/BOINCBaseView.cpp b/clientgui/BOINCBaseView.cpp index bfd24343b9..134da81c3c 100644 --- a/clientgui/BOINCBaseView.cpp +++ b/clientgui/BOINCBaseView.cpp @@ -298,11 +298,12 @@ void CBOINCBaseView::OnListRender(wxTimerEvent& event) { m_pListPane->SetItemCount(iDocCount); m_bNeedSort = true; } else { - // We can't just call SetItemCount() here because we need to - // let the virtual ListCtrl adjust its list of selected rows - // to remove (deselect) any beyond the new last row + // The virtual ListCtrl keeps a separate its list of selected rows; + // make sure it does not reference any rows beyond the new last row. + // We can ClearSelections() because we called SaveSelections() above. + ClearSelections(); + m_pListPane->SetItemCount(iDocCount); for (iIndex = (iCacheCount - 1); iIndex >= iDocCount; --iIndex) { - m_pListPane->DeleteItem(iIndex); iReturnValue = RemoveCacheElement(); wxASSERT(!iReturnValue); }