summaryrefslogtreecommitdiff
path: root/libopie/pim/orecordlist.h
Side-by-side diff
Diffstat (limited to 'libopie/pim/orecordlist.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/orecordlist.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/libopie/pim/orecordlist.h b/libopie/pim/orecordlist.h
index b6fa7fa..08f5c85 100644
--- a/libopie/pim/orecordlist.h
+++ b/libopie/pim/orecordlist.h
@@ -70,2 +70,3 @@ private:
T m_record;
+ bool m_direction :1;
@@ -127,2 +128,4 @@ ORecordListIterator<T>::ORecordListIterator() {
m_record = T();
+ /* forward */
+ m_direction = TRUE;
}
@@ -141,2 +144,3 @@ ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it) {
m_record = it.m_record;
+ m_direction = it.m_direction;
}
@@ -158,7 +162,5 @@ T ORecordListIterator<T>::operator*() {
if (!m_end )
- /* FIXME
- * until the cache is in place
- * we do the uid match uid check
- */
- m_record = m_temp->find( m_uids[m_current] );
+ m_record = m_temp->find( m_uids[m_current], m_uids, m_current,
+ m_direction ? Base::Forward :
+ Base::Reverse );
else
@@ -171,2 +173,3 @@ template <class T>
ORecordListIterator<T> &ORecordListIterator<T>::operator++() {
+ m_direction = true;
if (m_current < m_uids.count() ) {
@@ -181,2 +184,3 @@ template <class T>
ORecordListIterator<T> &ORecordListIterator<T>::operator--() {
+ m_direction = false;
if ( m_current > 0 ) {
@@ -209,3 +213,4 @@ ORecordListIterator<T>::ORecordListIterator( const QArray<int> uids,
const Base* t )
- : m_uids( uids ), m_current( 0 ), m_temp( t ), m_end( false )
+ : m_uids( uids ), m_current( 0 ), m_temp( t ), m_end( false ),
+ m_direction( false )
{
@@ -256,3 +261,4 @@ template <class T>
T ORecordList<T>::operator[]( uint i ) {
- return m_acc->find( m_ids[i] );
+ /* forward */
+ return m_acc->find( m_ids[i], m_ids, i );
}