author | zecke <zecke> | 2003-06-20 15:40:07 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-06-20 15:40:07 (UTC) |
commit | ec80e207cce9ebb55be771603fc47a4e7892fd6c (patch) (side-by-side diff) | |
tree | 0ec055e15a0ca1ec9ff0e9c674ecbcca389acbf4 /libopie/pim/otodoaccessxml.cpp | |
parent | c57f817ceca0eff0f6f3e90ad01654252911c1c5 (diff) | |
download | opie-ec80e207cce9ebb55be771603fc47a4e7892fd6c.zip opie-ec80e207cce9ebb55be771603fc47a4e7892fd6c.tar.gz opie-ec80e207cce9ebb55be771603fc47a4e7892fd6c.tar.bz2 |
toExtraMap is no more virtual
we save custom entries now
setExtraMap added as well
Diffstat (limited to 'libopie/pim/otodoaccessxml.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/otodoaccessxml.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/libopie/pim/otodoaccessxml.cpp b/libopie/pim/otodoaccessxml.cpp index 2b62f0d..3d15354 100644 --- a/libopie/pim/otodoaccessxml.cpp +++ b/libopie/pim/otodoaccessxml.cpp @@ -494,15 +494,37 @@ void OTodoAccessXML::todo( QAsciiDict<int>* dict, OTodo& ev, break; case FREndDate: { rp_end = (time_t) val.toLong(); break; } default: + ev.setCustomField( attr, val ); break; } } + +// from PalmtopRecord... GPL ### FIXME +namespace { +QString customToXml(const QMap<QString, QString>& customMap ) +{ + //qWarning(QString("writing custom %1").arg(customMap.count())); + QString buf(" "); + for ( QMap<QString, QString>::ConstIterator cit = customMap.begin(); + cit != customMap.end(); ++cit) { +// qWarning(".ITEM."); + buf += cit.key(); + buf += "=\""; + buf += Qtopia::escapeString(cit.data()); + buf += "\" "; + } + return buf; +} + + +} + QString OTodoAccessXML::toString( const OTodo& ev )const { QString str; str += "Completed=\"" + QString::number( ev.isCompleted() ) + "\" "; str += "HasDate=\"" + QString::number( ev.hasDueDate() ) + "\" "; str += "Priority=\"" + QString::number( ev.priority() ) + "\" "; @@ -578,12 +600,13 @@ QString OTodoAccessXML::toString( const OTodo& ev )const { for ( ; it != reminders.end(); ++it ) { records << QString::number( (*it).recordUid() ); } str += "Reminders=\""+ records.join(";") +"\" "; } } + str += customToXml( ev.toExtraMap() ); return str; } QString OTodoAccessXML::toString( const QArray<int>& ints ) const { return Qtopia::Record::idsToString( ints ); |