-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiepim/orecordlist.h | 12 | ||||
-rw-r--r-- | libopie2/opiepim/otodo.cpp | 21 |
3 files changed, 19 insertions, 16 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp index 21756c9..3a72881 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.cpp +++ b/libopie2/opiepim/backend/otodoaccessxml.cpp @@ -68,7 +68,6 @@ bool OTodoAccessXML::load() { element = element->nextChild(); } - return true; }else { qWarning("could not parse"); return false;; @@ -76,6 +75,7 @@ bool OTodoAccessXML::load() { delete root; m_opened = true; + qWarning("Access %d" + m_events.count() ); return true; } bool OTodoAccessXML::reload() { diff --git a/libopie2/opiepim/orecordlist.h b/libopie2/opiepim/orecordlist.h index 75bb33c..36728b8 100644 --- a/libopie2/opiepim/orecordlist.h +++ b/libopie2/opiepim/orecordlist.h @@ -40,7 +40,7 @@ public: * a * operator ;) * use it like this T = (*it); */ - T &operator*(); + T operator*(); ORecordListIterator &operator++(); ORecordListIterator &operator--(); @@ -99,6 +99,7 @@ ORecordListIterator<T>::ORecordListIterator() { m_current = 0; m_temp = 0l; m_end = true; + m_record = T(); } template <class T> ORecordListIterator<T>::~ORecordListIterator() { @@ -107,7 +108,7 @@ ORecordListIterator<T>::~ORecordListIterator() { template <class T> ORecordListIterator<T>::ORecordListIterator( const ORecordListIterator<T>& it) { - qWarning("ORecordListIterator"); +// qWarning("ORecordListIterator copy c'tor"); m_uids = it.m_uids; m_current = it.m_current; m_temp = it.m_temp; @@ -121,14 +122,14 @@ ORecordListIterator<T> &ORecordListIterator<T>::operator=( const ORecordListIter m_current = it.m_current; m_temp = it.m_temp; m_end = it.m_end; - m_record = it.m_record; +// m_record = it.m_record; return *this; } template <class T> -T &ORecordListIterator<T>::operator*() { - qWarning("operator* %d %d", m_current, m_uids[m_current] ); +T ORecordListIterator<T>::operator*() { +// qWarning("operator* %d %d", m_current, m_uids[m_current] ); if (!m_end ) m_record = m_temp->find( m_uids[m_current] ); else @@ -193,7 +194,6 @@ ORecordList<T>::~ORecordList() { } template <class T> ORecordList<T>::Iterator ORecordList<T>::begin() { - qWarning("ORecordList::begin"); Iterator it( m_ids, m_acc ); return it; } diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp index b3c14e6..cc46b21 100644 --- a/libopie2/opiepim/otodo.cpp +++ b/libopie2/opiepim/otodo.cpp @@ -36,12 +36,13 @@ OTodo::OTodo(const OTodo &event ) : OPimRecord( event ), data( event.data ) { data->ref(); - qWarning("ref up"); +// qWarning("ref up"); } OTodo::~OTodo() { - qWarning("~OTodo " + data->sum ); + +// qWarning("~OTodo " ); if ( data->deref() ) { - qWarning("OTodo::dereffing"); +// qWarning("OTodo::dereffing"); delete data; data = 0l; } @@ -54,7 +55,7 @@ OTodo::OTodo(bool completed, int priority, bool hasDate, QDate date, int uid ) : OPimRecord( uid ) { - qWarning("OTodoData " + summary); +// qWarning("OTodoData " + summary); setCategories( category ); data = new OTodoData; @@ -77,12 +78,12 @@ OTodo::OTodo(bool completed, int priority, bool hasDate, QDate date, int uid ) : OPimRecord( uid ) { - qWarning("OTodoData" + summary); +// qWarning("OTodoData" + summary); setCategories( idsFromString( category.join(";") ) ); data = new OTodoData; - data->date = date; + data->date = date; data->isCompleted = completed; data->hasDate = hasDate; data->priority = priority; @@ -160,6 +161,7 @@ void OTodo::setHasAlarmDateTime( bool hasAlarmDateTime ) } void OTodo::setDescription(const QString &desc ) { + qWarning( "desc " + desc ); changeOrModify(); data->desc = Qtopia::simplifyMultiLineSpace(desc ); } @@ -311,15 +313,16 @@ void OTodo::deref() { if ( data->deref() ) { //qWarning("deleting"); delete data; - d= 0; + data= 0; } } OTodo &OTodo::operator=(const OTodo &item ) { - OPimRecord::operator=( item ); +// OPimRecord::operator=( item ); //qWarning("operator= ref "); item.data->ref(); deref(); + data = item.data; return *this; } @@ -355,7 +358,7 @@ QMap<QString, QString> OTodo::toExtraMap()const { */ void OTodo::changeOrModify() { if ( data->count != 1 ) { - qWarning("changeOrModify"); +// qWarning("changeOrModify"); data->deref(); OTodoData* d2 = new OTodoData(); copy(data, d2 ); |