From e49230a12104b718c46a34c81b6c0e608c9d40be Mon Sep 17 00:00:00 2001 From: zecke Date: Sun, 22 Sep 2002 22:21:51 +0000 Subject: Add XML resources for todolist and compile fixes for RecordList --- (limited to 'libopie2/opiepim/orecordlist.h') 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 @@ -14,28 +14,30 @@ * for(it = list.begin(); it != list.end(); ++it ) * doSomeCoolStuff( (*it) ); */ +template class ORecordList; template class ORecordListIterator { + friend class ORecordList; public: typedef OTemplateBase Base; - + /** * The c'tor used internally from * ORecordList */ ORecordListIterator( const QArray, const Base* ); - + /** * The standard c'tor */ ORecordListIterator(); ~ORecordListIterator(); - + ORecordListIterator( const ORecordListIterator& ); ORecordListIterator &operator=(const ORecordListIterator& ); - + /** - * a * operator ;) + * a * operator ;) * use it like this T = (*it); */ T &operator*(); @@ -59,25 +61,25 @@ private: /** * The recordlist used as a return type * from OPimAccessTemplate - */ + */ template class ORecordList { public: typedef OTemplateBase Base; typedef ORecordListIterator Iterator; - - /** + + /** * c'tor */ ORecordList( const QArray& ids, const Base* ); ~ORecordList(); - + /** * the first iterator */ Iterator begin(); - + /** * the end */ @@ -105,6 +107,7 @@ ORecordListIterator::~ORecordListIterator() { template ORecordListIterator::ORecordListIterator( const ORecordListIterator& it) { + qWarning("ORecordListIterator"); m_uids = it.m_uids; m_current = it.m_current; m_temp = it.m_temp; @@ -125,6 +128,7 @@ ORecordListIterator &ORecordListIterator::operator=( const ORecordListIter template T &ORecordListIterator::operator*() { + qWarning("operator* %d %d", m_current, m_uids[m_current] ); if (!m_end ) m_record = m_temp->find( m_uids[m_current] ); else @@ -135,7 +139,7 @@ T &ORecordListIterator::operator*() { template ORecordListIterator &ORecordListIterator::operator++() { - if (m_current < m_uids.count() ) { + if (m_current < (int)m_uids.count() ) { m_end = false; ++m_current; }else @@ -189,6 +193,7 @@ ORecordList::~ORecordList() { } template ORecordList::Iterator ORecordList::begin() { + qWarning("ORecordList::begin"); Iterator it( m_ids, m_acc ); return it; } @@ -197,5 +202,7 @@ ORecordList::Iterator ORecordList::end() { Iterator it( m_ids, m_acc ); it.m_end = true; it.m_current = m_ids.count(); + + return it; } #endif -- cgit v0.9.0.2