summaryrefslogtreecommitdiffabout
path: root/libkcal
authorzautrix <zautrix>2004-12-04 04:53:22 (UTC)
committer zautrix <zautrix>2004-12-04 04:53:22 (UTC)
commit7828f46413766ee5db72dc9bd457eac0868f0646 (patch) (side-by-side diff)
treed3da09120bdef2b498f836c5b1b97a5b2aa2da99 /libkcal
parent967f7c879d06961dd7a25d019380c521f7a84792 (diff)
downloadkdepimpi-7828f46413766ee5db72dc9bd457eac0868f0646.zip
kdepimpi-7828f46413766ee5db72dc9bd457eac0868f0646.tar.gz
kdepimpi-7828f46413766ee5db72dc9bd457eac0868f0646.tar.bz2
fixed some bugs
Diffstat (limited to 'libkcal') (more/less context) (show whitespace changes)
-rw-r--r--libkcal/sharpformat.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libkcal/sharpformat.cpp b/libkcal/sharpformat.cpp
index 24b8349..c2ee2c9 100644
--- a/libkcal/sharpformat.cpp
+++ b/libkcal/sharpformat.cpp
@@ -233,50 +233,53 @@ class SharpParser : public QObject
todo->setDtDue( QDateTime(fromString( hasDateStr, false ).date(), QTime(0,0,0 )) );
todo->setFloats( true );
}
else {
todo->setDtDue( fromString( hasDateStr ) );
todo->setFloats( false );
}
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
+ 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;
int y,m,t,h,min,sec;
y = s.mid(0,4).toInt();
m = s.mid(4,2).toInt();
t = s.mid(6,2).toInt();
h = s.mid(9,2).toInt();
min = s.mid(11,2).toInt();
sec = s.mid(13,2).toInt();
dt = QDateTime(QDate(y,m,t), QTime(h,min,sec));