summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/todo.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 7906046..19a7ffd 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -59,3 +59,3 @@ Todo::~Todo()
setRunning( false );
- qDebug("Todo::~Todo() ");
+ //qDebug("Todo::~Todo() ");
}
@@ -86,12 +86,6 @@ void Todo::saveRunningInfoToFile()
qDebug("%s ", dir.latin1());
- QString file = "%1%2%3-%4%5%6-%7%8%9-";
- int runtime = mRunStart.secsTo( QDateTime::currentDateTime() );
- runtime = (runtime / 60) +1;
- int h = runtime / 60;
- int m = runtime % 60;
- int d = h / 24;
- h = h % 24;
- file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 ).arg( d,3 ).arg( h,2 ).arg( m,2 );
+ QString file = "%1%2%3-%4%5%6-";
+ file = file.arg( mRunStart.date().year(), 4).arg( mRunStart.date().month(),2 ).arg( mRunStart.date().day(), 2 ).arg( mRunStart.time().hour(),2 ).arg( mRunStart.time().minute(),2 ).arg( mRunStart.time().second(),2 );
file.replace ( QRegExp (" "), "0" );
- file = dir +"/" +file + uid()+".ics";
+ file += uid();
qDebug("File %s ",file.latin1() );
@@ -99,4 +93,12 @@ void Todo::saveRunningInfoToFile()
cal.setTimeZoneId( " 00:00 Europe/London(UTC)" );
- cal.addIncidence( clone() );
+ Todo * to = (Todo*) clone();
+ to->setFloats( false );
+ to->setDtStart( mRunStart );
+ to->setHasStartDate( true );
+ to->setDtDue( QDateTime::currentDateTime() );
+ to->setHasDueDate( true );
+ to->setUid( file );
+ cal.addIncidence( to );
ICalFormat format;
+ file = dir +"/" +file +".ics";
format.save( &cal, file );
@@ -241,3 +243,2 @@ void Todo::setDtDue(const QDateTime &dtDue)
alarm->setAlarmStart(mDtDue);*/
-
updated();