summaryrefslogtreecommitdiffabout
path: root/libkcal
Side-by-side diff
Diffstat (limited to 'libkcal') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/todo.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp
index c008fe1..8794f7a 100644
--- a/libkcal/todo.cpp
+++ b/libkcal/todo.cpp
@@ -58,64 +58,77 @@ Todo::~Todo()
}
void Todo::setRunning( bool run )
{
if ( run == mRunning )
return;
if ( !mRunSaveTimer ) {
mRunSaveTimer = new QTimer ( this );
connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) );
}
mRunning = run;
if ( mRunning ) {
mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min
mRunStart = QDateTime::currentDateTime();
} else {
mRunSaveTimer->stop();
saveRunningInfoToFile();
}
}
void Todo::saveRunningInfoToFile()
{
qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1());
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 );
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
}
int Todo::runTime()
{
if ( !mRunning )
return 0;
return mRunStart.secsTo( QDateTime::currentDateTime() );
}
bool Todo::hasRunningSub()
{
if ( mRunning )
return true;
Incidence *aTodo;
for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) {
if ( ((Todo*)aTodo)->hasRunningSub() )
return true;
}
return false;
}
Incidence *Todo::clone()
{
return new Todo(*this);
}
bool Todo::contains ( Todo* from )
{
if ( !from->summary().isEmpty() )
if ( !summary().startsWith( from->summary() ))