-rw-r--r-- | libkcal/todo.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 002d3f2..f7e38a7 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -61,6 +61,14 @@ Todo::~Todo() | |||
61 | //qDebug("Todo::~Todo() "); | 61 | //qDebug("Todo::~Todo() "); |
62 | } | 62 | } |
63 | 63 | ||
64 | void Todo::setRunningFalse( QString s ) | ||
65 | { | ||
66 | if ( ! mRunning ) | ||
67 | return; | ||
68 | mRunning = false; | ||
69 | mRunSaveTimer->stop(); | ||
70 | saveRunningInfoToFile( s ); | ||
71 | } | ||
64 | void Todo::setRunning( bool run ) | 72 | void Todo::setRunning( bool run ) |
65 | { | 73 | { |
66 | if ( run == mRunning ) | 74 | if ( run == mRunning ) |
@@ -80,7 +88,7 @@ void Todo::setRunning( bool run ) | |||
80 | } | 88 | } |
81 | } | 89 | } |
82 | 90 | ||
83 | void Todo::saveRunningInfoToFile() | 91 | void Todo::saveRunningInfoToFile( QString comment ) |
84 | { | 92 | { |
85 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); | 93 | //qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); |
86 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { | 94 | if ( mRunStart.secsTo ( QDateTime::currentDateTime() ) < 30 ) { |
@@ -103,6 +111,9 @@ void Todo::saveRunningInfoToFile() | |||
103 | to->setDtDue( QDateTime::currentDateTime() ); | 111 | to->setDtDue( QDateTime::currentDateTime() ); |
104 | to->setHasDueDate( true ); | 112 | to->setHasDueDate( true ); |
105 | to->setUid( file ); | 113 | to->setUid( file ); |
114 | if ( !comment.isEmpty() ) { | ||
115 | to->setDescription( comment ); | ||
116 | } | ||
106 | cal.addIncidence( to ); | 117 | cal.addIncidence( to ); |
107 | ICalFormat format; | 118 | ICalFormat format; |
108 | file = dir +"/" +file +".ics"; | 119 | file = dir +"/" +file +".ics"; |