From 461113126af82cd6343eedab36ecabb4253780ee Mon Sep 17 00:00:00 2001 From: zecke Date: Fri, 18 Oct 2002 14:09:14 +0000 Subject: Add a small quirk mode... for testing Fix parsing of due Date We can not rely that HasDate is past the dates.. do the final QDate generation just before adding the OTodo --- (limited to 'libopie') diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp index 7a55c67..385fd27 100644 --- a/libopie/pim/otodoaccessxml.cpp +++ b/libopie/pim/otodoaccessxml.cpp @@ -116,7 +116,15 @@ bool OTodoAccessXML::load() { /* * now add it */ + if (m_events.contains( ev.uid() ) || ev.uid() == 0) { + ev.setUid( 1 ); + m_changed = true; + } + if ( ev.hasDueDate() ) { + ev.setDueDate( QDate(m_year, m_month, m_day) ); + } m_events.insert(ev.uid(), ev ); + m_year = m_month = m_day = -1; } qWarning("counts %d records loaded!", m_events.count() ); @@ -339,11 +347,6 @@ void OTodoAccessXML::todo( QAsciiDict* dict, OTodo& ev, default: break; } - - if ( ev.hasDueDate() ) { - QDate date( m_year, m_month, m_day ); - ev.setDueDate( date ); - } } QString OTodoAccessXML::toString( const OTodo& ev )const { QString str; -- cgit v0.9.0.2