summaryrefslogtreecommitdiffabout
Unidiff
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()
59 setRunning( false ); 59 setRunning( false );
60 qDebug("Todo::~Todo() "); 60 //qDebug("Todo::~Todo() ");
61} 61}
@@ -86,12 +86,6 @@ void Todo::saveRunningInfoToFile()
86 qDebug("%s ", dir.latin1()); 86 qDebug("%s ", dir.latin1());
87 QString file = "%1%2%3-%4%5%6-%7%8%9-"; 87 QString file = "%1%2%3-%4%5%6-";
88 int runtime = mRunStart.secsTo( QDateTime::currentDateTime() ); 88 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 );
89 runtime = (runtime / 60) +1;
90 int h = runtime / 60;
91 int m = runtime % 60;
92 int d = h / 24;
93 h = h % 24;
94 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 );
95 file.replace ( QRegExp (" "), "0" ); 89 file.replace ( QRegExp (" "), "0" );
96 file = dir +"/" +file + uid()+".ics"; 90 file += uid();
97 qDebug("File %s ",file.latin1() ); 91 qDebug("File %s ",file.latin1() );
@@ -99,4 +93,12 @@ void Todo::saveRunningInfoToFile()
99 cal.setTimeZoneId( " 00:00 Europe/London(UTC)" ); 93 cal.setTimeZoneId( " 00:00 Europe/London(UTC)" );
100 cal.addIncidence( clone() ); 94 Todo * to = (Todo*) clone();
95 to->setFloats( false );
96 to->setDtStart( mRunStart );
97 to->setHasStartDate( true );
98 to->setDtDue( QDateTime::currentDateTime() );
99 to->setHasDueDate( true );
100 to->setUid( file );
101 cal.addIncidence( to );
101 ICalFormat format; 102 ICalFormat format;
103 file = dir +"/" +file +".ics";
102 format.save( &cal, file ); 104 format.save( &cal, file );
@@ -241,3 +243,2 @@ void Todo::setDtDue(const QDateTime &dtDue)
241 alarm->setAlarmStart(mDtDue);*/ 243 alarm->setAlarmStart(mDtDue);*/
242
243 updated(); 244 updated();