summaryrefslogtreecommitdiffabout
path: root/libkcal
Unidiff
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
233 todo->setDtDue( QDateTime(fromString( hasDateStr, false ).date(), QTime(0,0,0 )) ); 233 todo->setDtDue( QDateTime(fromString( hasDateStr, false ).date(), QTime(0,0,0 )) );
234 todo->setFloats( true ); 234 todo->setFloats( true );
235 } 235 }
236 else { 236 else {
237 todo->setDtDue( fromString( hasDateStr ) ); 237 todo->setDtDue( fromString( hasDateStr ) );
238 todo->setFloats( false ); 238 todo->setFloats( false );
239 } 239 }
240 240
241 todo->setHasDueDate( true ); 241 todo->setHasDueDate( true );
242 } 242 }
243 hasDateStr = attList[2];//start 243 hasDateStr = attList[2];//start
244 if ( !hasDateStr.isEmpty() ) { 244 if ( !hasDateStr.isEmpty() ) {
245 245
246 todo->setDtStart( fromString( hasDateStr ) ); 246 todo->setDtStart( fromString( hasDateStr ) );
247 todo->setHasStartDate( true); 247 todo->setHasStartDate( true);
248 } else 248 } else
249 todo->setHasStartDate( false ); 249 todo->setHasStartDate( false );
250 hasDateStr = attList[4];//completed 250 hasDateStr = attList[4];//completed
251 if ( !hasDateStr.isEmpty() ) { 251 if ( !hasDateStr.isEmpty() ) {
252 todo->setCompleted(fromString( hasDateStr ) ); 252 todo->setCompleted(fromString( hasDateStr ) );
253 } 253 }
254 QString completedStr = attList[5]; 254 QString completedStr = attList[5];
255 if ( completedStr == "0" ) 255 if ( completedStr == "0" )
256 todo->setCompleted( true ); 256 todo->setCompleted( true );
257 else 257 else {
258 // do not change percent complete
259 if ( todo->isCompleted() )
258 todo->setCompleted( false ); 260 todo->setCompleted( false );
261 }
259 mCalendar->addTodo( todo ); 262 mCalendar->addTodo( todo );
260 263
261 } else if ( qName == "Category" ) { 264 } else if ( qName == "Category" ) {
262 /* 265 /*
263 QString id = attributes.value( "id" ); 266 QString id = attributes.value( "id" );
264 QString name = attributes.value( "name" ); 267 QString name = attributes.value( "name" );
265 setCategory( id, name ); 268 setCategory( id, name );
266 */ 269 */
267 } 270 }
268 //qDebug("end "); 271 //qDebug("end ");
269 return true; 272 return true;
270 } 273 }
271 274
272 275
273 QDateTime fromString ( QString s, bool useTz = true ) { 276 QDateTime fromString ( QString s, bool useTz = true ) {
274 QDateTime dt; 277 QDateTime dt;
275 int y,m,t,h,min,sec; 278 int y,m,t,h,min,sec;
276 y = s.mid(0,4).toInt(); 279 y = s.mid(0,4).toInt();
277 m = s.mid(4,2).toInt(); 280 m = s.mid(4,2).toInt();
278 t = s.mid(6,2).toInt(); 281 t = s.mid(6,2).toInt();
279 h = s.mid(9,2).toInt(); 282 h = s.mid(9,2).toInt();
280 min = s.mid(11,2).toInt(); 283 min = s.mid(11,2).toInt();
281 sec = s.mid(13,2).toInt(); 284 sec = s.mid(13,2).toInt();
282 dt = QDateTime(QDate(y,m,t), QTime(h,min,sec)); 285 dt = QDateTime(QDate(y,m,t), QTime(h,min,sec));