From 79b12b680f6a0653bcff84c8ef83b23803246b7d Mon Sep 17 00:00:00 2001 From: zautrix Date: Sun, 10 Apr 2005 08:53:14 +0000 Subject: fixes --- (limited to 'libkcal/todo.cpp') diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 8794f7a..7906046 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp @@ -24,6 +24,8 @@ #include #include +#include "calendarlocal.h" +#include "icalformat.h" #include "todo.h" using namespace KCal; @@ -55,6 +57,7 @@ Todo::Todo(const Todo &t) : Incidence(t) Todo::~Todo() { setRunning( false ); + qDebug("Todo::~Todo() "); } void Todo::setRunning( bool run ) @@ -81,28 +84,23 @@ void Todo::saveRunningInfoToFile() QString dir = KGlobalSettings::timeTrackerDir(); 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 ); - - } int Todo::runTime() -- cgit v0.9.0.2