summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/orecordlist.h
authorzecke <zecke>2002-09-22 22:21:51 (UTC)
committer zecke <zecke>2002-09-22 22:21:51 (UTC)
commite49230a12104b718c46a34c81b6c0e608c9d40be (patch) (unidiff)
tree4ef2e58c366a8cf7c4abe04838e255b38613fbcb /libopie2/opiepim/orecordlist.h
parent3049d9418b882283814ca71baa98420b2a6745db (diff)
downloadopie-e49230a12104b718c46a34c81b6c0e608c9d40be.zip
opie-e49230a12104b718c46a34c81b6c0e608c9d40be.tar.gz
opie-e49230a12104b718c46a34c81b6c0e608c9d40be.tar.bz2
Add XML resources for todolist and compile fixes for RecordList
Diffstat (limited to 'libopie2/opiepim/orecordlist.h') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/orecordlist.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/libopie2/opiepim/orecordlist.h b/libopie2/opiepim/orecordlist.h
index 3b30a73..75bb33c 100644
--- a/libopie2/opiepim/orecordlist.h
+++ b/libopie2/opiepim/orecordlist.h
@@ -11,14 +11,16 @@
11 * Our List Iterator 11 * Our List Iterator
12 * it behaves like STL or Qt 12 * it behaves like STL or Qt
13 * 13 *
14 * for(it = list.begin(); it != list.end(); ++it ) 14 * for(it = list.begin(); it != list.end(); ++it )
15 * doSomeCoolStuff( (*it) ); 15 * doSomeCoolStuff( (*it) );
16 */ 16 */
17template <class T> class ORecordList;
17template <class T = OPimRecord> 18template <class T = OPimRecord>
18class ORecordListIterator { 19class ORecordListIterator {
20 friend class ORecordList<T>;
19public: 21public:
20 typedef OTemplateBase<T> Base; 22 typedef OTemplateBase<T> Base;
21 23
22 /** 24 /**
23 * The c'tor used internally from 25 * The c'tor used internally from
24 * ORecordList 26 * ORecordList
@@ -102,12 +104,13 @@ template <class T>
102ORecordListIterator<T>::~ORecordListIterator() { 104ORecordListIterator<T>::~ORecordListIterator() {
103/* nothing to delete */ 105/* nothing to delete */
104} 106}
105 107
106template <class T> 108template <class T>
107ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it) { 109ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it) {
110 qWarning("ORecordListIterator");
108 m_uids = it.m_uids; 111 m_uids = it.m_uids;
109 m_current = it.m_current; 112 m_current = it.m_current;
110 m_temp = it.m_temp; 113 m_temp = it.m_temp;
111 m_end = it.m_end; 114 m_end = it.m_end;
112 m_record = it.m_record; 115 m_record = it.m_record;
113} 116}
@@ -122,23 +125,24 @@ ORecordListIterator<T> &ORecordListIterator<T>::operator=( const ORecordListIter
122 125
123 return *this; 126 return *this;
124} 127}
125 128
126template <class T> 129template <class T>
127T &ORecordListIterator<T>::operator*() { 130T &ORecordListIterator<T>::operator*() {
131 qWarning("operator* %d %d", m_current, m_uids[m_current] );
128 if (!m_end ) 132 if (!m_end )
129 m_record = m_temp->find( m_uids[m_current] ); 133 m_record = m_temp->find( m_uids[m_current] );
130 else 134 else
131 m_record = T(); 135 m_record = T();
132 136
133 return m_record; 137 return m_record;
134} 138}
135 139
136template <class T> 140template <class T>
137ORecordListIterator<T> &ORecordListIterator<T>::operator++() { 141ORecordListIterator<T> &ORecordListIterator<T>::operator++() {
138 if (m_current < m_uids.count() ) { 142 if (m_current < (int)m_uids.count() ) {
139 m_end = false; 143 m_end = false;
140 ++m_current; 144 ++m_current;
141 }else 145 }else
142 m_end = true; 146 m_end = true;
143 147
144 return *this; 148 return *this;
@@ -186,16 +190,19 @@ ORecordList<T>::ORecordList( const QArray<int>& ids,
186template <class T> 190template <class T>
187ORecordList<T>::~ORecordList() { 191ORecordList<T>::~ORecordList() {
188/* nothing to do here */ 192/* nothing to do here */
189} 193}
190template <class T> 194template <class T>
191ORecordList<T>::Iterator ORecordList<T>::begin() { 195ORecordList<T>::Iterator ORecordList<T>::begin() {
196 qWarning("ORecordList::begin");
192 Iterator it( m_ids, m_acc ); 197 Iterator it( m_ids, m_acc );
193 return it; 198 return it;
194} 199}
195template <class T> 200template <class T>
196ORecordList<T>::Iterator ORecordList<T>::end() { 201ORecordList<T>::Iterator ORecordList<T>::end() {
197 Iterator it( m_ids, m_acc ); 202 Iterator it( m_ids, m_acc );
198 it.m_end = true; 203 it.m_end = true;
199 it.m_current = m_ids.count(); 204 it.m_current = m_ids.count();
205
206 return it;
200} 207}
201#endif 208#endif