author | zautrix <zautrix> | 2005-04-09 21:20:36 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-09 21:20:36 (UTC) |
commit | 54f5fe5e6f4909109edf915513c02f7af3e7bb2d (patch) (unidiff) | |
tree | 66c7bcdd8ce6dcbbb6710220c1c3503c83c33d3b /libkcal | |
parent | ae58b2fe29fcd8b3690dcbb6d64976674f6294e0 (diff) | |
download | kdepimpi-54f5fe5e6f4909109edf915513c02f7af3e7bb2d.zip kdepimpi-54f5fe5e6f4909109edf915513c02f7af3e7bb2d.tar.gz kdepimpi-54f5fe5e6f4909109edf915513c02f7af3e7bb2d.tar.bz2 |
fix
-rw-r--r-- | libkcal/todo.cpp | 13 |
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 | |||
@@ -66,48 +66,61 @@ void Todo::setRunning( bool run ) | |||
66 | connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); | 66 | connect ( mRunSaveTimer, SIGNAL( timeout() ), this , SLOT ( saveRunningInfoToFile() ) ); |
67 | } | 67 | } |
68 | mRunning = run; | 68 | mRunning = run; |
69 | if ( mRunning ) { | 69 | if ( mRunning ) { |
70 | mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min | 70 | mRunSaveTimer->start( 1000 * 60 * 5 ); // 5 min |
71 | mRunStart = QDateTime::currentDateTime(); | 71 | mRunStart = QDateTime::currentDateTime(); |
72 | } else { | 72 | } else { |
73 | mRunSaveTimer->stop(); | 73 | mRunSaveTimer->stop(); |
74 | saveRunningInfoToFile(); | 74 | saveRunningInfoToFile(); |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
78 | void Todo::saveRunningInfoToFile() | 78 | void Todo::saveRunningInfoToFile() |
79 | { | 79 | { |
80 | qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); | 80 | qDebug("Todo::saveRunningInfoToFile() %s", summary().latin1()); |
81 | 81 | ||
82 | QString dir = KGlobalSettings::timeTrackerDir(); | 82 | QString dir = KGlobalSettings::timeTrackerDir(); |
83 | qDebug("%s ", dir.latin1()); | 83 | qDebug("%s ", dir.latin1()); |
84 | QString file = "%1-%2-%3-%4-%5-%6-%7.tt"; | 84 | QString file = "%1-%2-%3-%4-%5-%6-%7.tt"; |
85 | 85 | ||
86 | 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 ); | 86 | 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 ); |
87 | file.replace ( QRegExp (" "), "0" ); | 87 | file.replace ( QRegExp (" "), "0" ); |
88 | file = dir +"/" +file; | 88 | file = dir +"/" +file; |
89 | qDebug("%s ", file.latin1()); | 89 | qDebug("%s ", file.latin1()); |
90 | QStringList dataList; | ||
91 | |||
92 | //Summary | ||
93 | //Category | ||
94 | //CategoryColor | ||
95 | //StartRuntime | ||
96 | //Runtime | ||
97 | //Due | ||
98 | //Start | ||
99 | //Prio | ||
100 | //Erledigt | ||
101 | //Uid | ||
102 | //Parents uids | ||
90 | 103 | ||
91 | 104 | ||
92 | 105 | ||
93 | } | 106 | } |
94 | 107 | ||
95 | int Todo::runTime() | 108 | int Todo::runTime() |
96 | { | 109 | { |
97 | if ( !mRunning ) | 110 | if ( !mRunning ) |
98 | return 0; | 111 | return 0; |
99 | return mRunStart.secsTo( QDateTime::currentDateTime() ); | 112 | return mRunStart.secsTo( QDateTime::currentDateTime() ); |
100 | } | 113 | } |
101 | bool Todo::hasRunningSub() | 114 | bool Todo::hasRunningSub() |
102 | { | 115 | { |
103 | if ( mRunning ) | 116 | if ( mRunning ) |
104 | return true; | 117 | return true; |
105 | Incidence *aTodo; | 118 | Incidence *aTodo; |
106 | for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) { | 119 | for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) { |
107 | if ( ((Todo*)aTodo)->hasRunningSub() ) | 120 | if ( ((Todo*)aTodo)->hasRunningSub() ) |
108 | return true; | 121 | return true; |
109 | } | 122 | } |
110 | return false; | 123 | return false; |
111 | } | 124 | } |
112 | Incidence *Todo::clone() | 125 | Incidence *Todo::clone() |
113 | { | 126 | { |