summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/orecordlist.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/orecordlist.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/orecordlist.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/libopie2/opiepim/orecordlist.h b/libopie2/opiepim/orecordlist.h
index b6fa7fa..08f5c85 100644
--- a/libopie2/opiepim/orecordlist.h
+++ b/libopie2/opiepim/orecordlist.h
@@ -69,4 +69,5 @@ private:
69 bool m_end : 1; 69 bool m_end : 1;
70 T m_record; 70 T m_record;
71 bool m_direction :1;
71 72
72 /* d pointer for future versions */ 73 /* d pointer for future versions */
@@ -126,4 +127,6 @@ ORecordListIterator<T>::ORecordListIterator() {
126 m_end = true; 127 m_end = true;
127 m_record = T(); 128 m_record = T();
129 /* forward */
130 m_direction = TRUE;
128} 131}
129template <class T> 132template <class T>
@@ -140,4 +143,5 @@ ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it) {
140 m_end = it.m_end; 143 m_end = it.m_end;
141 m_record = it.m_record; 144 m_record = it.m_record;
145 m_direction = it.m_direction;
142} 146}
143 147
@@ -157,9 +161,7 @@ T ORecordListIterator<T>::operator*() {
157 qWarning("operator* %d %d", m_current, m_uids[m_current] ); 161 qWarning("operator* %d %d", m_current, m_uids[m_current] );
158 if (!m_end ) 162 if (!m_end )
159 /* FIXME 163 m_record = m_temp->find( m_uids[m_current], m_uids, m_current,
160 * until the cache is in place 164 m_direction ? Base::Forward :
161 * we do the uid match uid check 165 Base::Reverse );
162 */
163 m_record = m_temp->find( m_uids[m_current] );
164 else 166 else
165 m_record = T(); 167 m_record = T();
@@ -170,4 +172,5 @@ T ORecordListIterator<T>::operator*() {
170template <class T> 172template <class T>
171ORecordListIterator<T> &ORecordListIterator<T>::operator++() { 173ORecordListIterator<T> &ORecordListIterator<T>::operator++() {
174 m_direction = true;
172 if (m_current < m_uids.count() ) { 175 if (m_current < m_uids.count() ) {
173 m_end = false; 176 m_end = false;
@@ -180,4 +183,5 @@ ORecordListIterator<T> &ORecordListIterator<T>::operator++() {
180template <class T> 183template <class T>
181ORecordListIterator<T> &ORecordListIterator<T>::operator--() { 184ORecordListIterator<T> &ORecordListIterator<T>::operator--() {
185 m_direction = false;
182 if ( m_current > 0 ) { 186 if ( m_current > 0 ) {
183 --m_current; 187 --m_current;
@@ -208,5 +212,6 @@ template <class T>
208ORecordListIterator<T>::ORecordListIterator( const QArray<int> uids, 212ORecordListIterator<T>::ORecordListIterator( const QArray<int> uids,
209 const Base* t ) 213 const Base* t )
210 : m_uids( uids ), m_current( 0 ), m_temp( t ), m_end( false ) 214 : m_uids( uids ), m_current( 0 ), m_temp( t ), m_end( false ),
215 m_direction( false )
211{ 216{
212} 217}
@@ -255,5 +260,6 @@ return m_ids.count();
255template <class T> 260template <class T>
256T ORecordList<T>::operator[]( uint i ) { 261T ORecordList<T>::operator[]( uint i ) {
257 return m_acc->find( m_ids[i] ); 262 /* forward */
263 return m_acc->find( m_ids[i], m_ids, i );
258} 264}
259#endif 265#endif