-rw-r--r-- | libkcal/sharpformat.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp index 24b8349..c2ee2c9 100644 --- a/libkcal/sharpformat.cpp +++ b/libkcal/sharpformat.cpp @@ -241,34 +241,37 @@ class SharpParser : public QObject todo->setHasDueDate( true ); } hasDateStr = attList[2];//start if ( !hasDateStr.isEmpty() ) { todo->setDtStart( fromString( hasDateStr ) ); todo->setHasStartDate( true); } else todo->setHasStartDate( false ); hasDateStr = attList[4];//completed if ( !hasDateStr.isEmpty() ) { todo->setCompleted(fromString( hasDateStr ) ); } QString completedStr = attList[5]; if ( completedStr == "0" ) todo->setCompleted( true ); - else - todo->setCompleted( false ); + else { + // do not change percent complete + if ( todo->isCompleted() ) + todo->setCompleted( false ); + } mCalendar->addTodo( todo ); } else if ( qName == "Category" ) { /* QString id = attributes.value( "id" ); QString name = attributes.value( "name" ); setCategory( id, name ); */ } //qDebug("end "); return true; } QDateTime fromString ( QString s, bool useTz = true ) { QDateTime dt; |