summaryrefslogtreecommitdiffabout
path: root/libkcal/todo.cpp
authorzautrix <zautrix>2005-04-10 08:53:14 (UTC)
committer zautrix <zautrix>2005-04-10 08:53:14 (UTC)
commit79b12b680f6a0653bcff84c8ef83b23803246b7d (patch) (side-by-side diff)
tree05e4c6d7ac0446eacb7dff6ca466f656b3152793 /libkcal/todo.cpp
parent54f5fe5e6f4909109edf915513c02f7af3e7bb2d (diff)
downloadkdepimpi-79b12b680f6a0653bcff84c8ef83b23803246b7d.zip
kdepimpi-79b12b680f6a0653bcff84c8ef83b23803246b7d.tar.gz
kdepimpi-79b12b680f6a0653bcff84c8ef83b23803246b7d.tar.bz2
fixes
Diffstat (limited to 'libkcal/todo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/todo.cpp38
1 files changed, 18 insertions, 20 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index 8794f7a..7906046 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -26,2 +26,4 @@
+#include "calendarlocal.h"
+#include "icalformat.h"
#include "todo.h"
@@ -57,2 +59,3 @@ Todo::~Todo()
setRunning( false );
+ qDebug("Todo::~Todo() ");
}
@@ -83,24 +86,19 @@ void Todo::saveRunningInfoToFile()
qDebug("%s ", dir.latin1());
- QString file = "%1-%2-%3-%4-%5-%6-%7.tt";
-
- 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( mRunStart.time().msec(), 3 );
+ 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 );
file.replace ( QRegExp (" "), "0" );
- file = dir +"/" +file;
- qDebug("%s ", file.latin1());
- QStringList dataList;
-
- //Summary
- //Category
- //CategoryColor
- //StartRuntime
- //Runtime
- //Due
- //Start
- //Prio
- //Erledigt
- //Uid
- //Parents uids
+ file = dir +"/" +file + uid()+".ics";
+ qDebug("File %s ",file.latin1() );
+ CalendarLocal cal;
+ cal.setTimeZoneId( " 00:00 Europe/London(UTC)" );
+ cal.addIncidence( clone() );
+ ICalFormat format;
+ format.save( &cal, file );
-
-
}