author | erik <erik> | 2007-01-10 02:48:16 (UTC) |
---|---|---|
committer | erik <erik> | 2007-01-10 02:48:16 (UTC) |
commit | 3c4c894bcdb1e49ce4d3e8167c8a21b1c617037d (patch) (side-by-side diff) | |
tree | 116c28349992668c69756a46fa90838889b21a6b | |
parent | 5e9659c695af1d1afb20a377775f1349b83eca53 (diff) | |
download | opie-3c4c894bcdb1e49ce4d3e8167c8a21b1c617037d.zip opie-3c4c894bcdb1e49ce4d3e8167c8a21b1c617037d.tar.gz opie-3c4c894bcdb1e49ce4d3e8167c8a21b1c617037d.tar.bz2 |
BUG: The todo program was printing bad XML output of recurring items
because the code lacked a space between two entities.
FIX: Add a space.
NOTE: The code was additionally reworked to make the spaces more noticable
to the author of the patch.
Thanks goes to Paul Eggleton who provided the patch!
This fixes Opie bug 1753:
http://opie-bugs.oszine.de/view.php?id=1753
-rw-r--r-- | libopie2/opiepim/backend/otodoaccessxml.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/libopie2/opiepim/backend/otodoaccessxml.cpp b/libopie2/opiepim/backend/otodoaccessxml.cpp index ab50604..7a08f12 100644 --- a/libopie2/opiepim/backend/otodoaccessxml.cpp +++ b/libopie2/opiepim/backend/otodoaccessxml.cpp @@ -534,98 +534,98 @@ QString customToXml(const QMap<QString, QString>& customMap ) buf += Qtopia::escapeString(cit.data()); buf += "\" "; } return buf; } } QString OPimTodoAccessXML::toString( const OPimTodo& ev )const { QString str; - str += "Completed=\"" + QString::number( ev.isCompleted() ) + "\" "; - str += "HasDate=\"" + QString::number( ev.hasDueDate() ) + "\" "; - str += "Priority=\"" + QString::number( ev.priority() ) + "\" "; - str += "Progress=\"" + QString::number(ev.progress() ) + "\" "; + str += "Completed=\"" + QString::number( ev.isCompleted() ) + "\""; + str += " HasDate=\"" + QString::number( ev.hasDueDate() ) + "\""; + str += " Priority=\"" + QString::number( ev.priority() ) + "\""; + str += " Progress=\"" + QString::number(ev.progress() ) + "\""; - str += "Categories=\"" + toString( ev.categories() ) + "\" "; - str += "Description=\"" + Qtopia::escapeString( ev.description() ) + "\" "; - str += "Summary=\"" + Qtopia::escapeString( ev.summary() ) + "\" "; + str += " Categories=\"" + toString( ev.categories() ) + "\""; + str += " Description=\"" + Qtopia::escapeString( ev.description() ) + "\""; + str += " Summary=\"" + Qtopia::escapeString( ev.summary() ) + "\""; if ( ev.hasDueDate() ) { - str += "DateYear=\"" + QString::number( ev.dueDate().year() ) + "\" "; - str += "DateMonth=\"" + QString::number( ev.dueDate().month() ) + "\" "; - str += "DateDay=\"" + QString::number( ev.dueDate().day() ) + "\" "; + str += " DateYear=\"" + QString::number( ev.dueDate().year() ) + "\""; + str += " DateMonth=\"" + QString::number( ev.dueDate().month() ) + "\""; + str += " DateDay=\"" + QString::number( ev.dueDate().day() ) + "\""; } - str += "Uid=\"" + QString::number( ev.uid() ) + "\" "; + str += " Uid=\"" + QString::number( ev.uid() ) + "\""; // append the extra options /* FIXME Qtopia::Record this is currently not * possible you can set custom fields * but don' iterate over the list * I may do #define private protected * for this case - cough --zecke */ /* QMap<QString, QString> extras = ev.extras(); QMap<QString, QString>::Iterator extIt; for (extIt = extras.begin(); extIt != extras.end(); ++extIt ) - str += extIt.key() + "=\"" + extIt.data() + "\" "; + str += " " + extIt.key() + "=\"" + extIt.data() + "\""; */ // cross refernce if ( ev.hasRecurrence() ) { str += ev.recurrence().toString(); } if ( ev.hasStartDate() ) - str += "StartDate=\""+ OPimDateConversion::dateToString( ev.startDate() ) +"\" "; + str += " StartDate=\""+ OPimDateConversion::dateToString( ev.startDate() ) +"\""; if ( ev.hasCompletedDate() ) - str += "CompletedDate=\""+ OPimDateConversion::dateToString( ev.completedDate() ) +"\" "; + str += " CompletedDate=\""+ OPimDateConversion::dateToString( ev.completedDate() ) +"\""; if ( ev.hasState() ) - str += "State=\""+QString::number( ev.state().state() )+"\" "; + str += " State=\""+QString::number( ev.state().state() )+"\""; /* * save reminders and notifiers! * DATE_TIME:DURATION:SOUND:NOT_USED_YET;OTHER_DATE_TIME:OTHER_DURATION:SOUND:.... */ if ( ev.hasNotifiers() ) { OPimNotifyManager manager = ev.notifiers(); OPimNotifyManager::Alarms alarms = manager.alarms(); if (!alarms.isEmpty() ) { QStringList als; OPimNotifyManager::Alarms::Iterator it = alarms.begin(); for ( ; it != alarms.end(); ++it ) { /* only if time is valid */ if ( (*it).dateTime().isValid() ) { als << OPimDateConversion::dateTimeToString( (*it).dateTime() ) + ":" + QString::number( (*it).duration() ) + ":" + QString::number( (*it).sound() ) + ":"; } } // now write the list - str += "Alarms=\""+als.join(";") +"\" "; + str += " Alarms=\""+als.join(";") +"\""; } /* * now the same for reminders but more easy. We just save the uid of the OPimEvent. */ OPimNotifyManager::Reminders reminders = manager.reminders(); if (!reminders.isEmpty() ) { OPimNotifyManager::Reminders::Iterator it = reminders.begin(); QStringList records; for ( ; it != reminders.end(); ++it ) { records << QString::number( (*it).recordUid() ); } - str += "Reminders=\""+ records.join(";") +"\" "; + str += " Reminders=\""+ records.join(";") +"\""; } } str += customToXml( ev.toExtraMap() ); return str; } QString OPimTodoAccessXML::toString( const QArray<int>& ints ) const { return Qtopia::Record::idsToString( ints ); } |