author | zautrix <zautrix> | 2005-04-16 10:17:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-04-16 10:17:05 (UTC) |
commit | 6cf5cc7d0b12af6bdc722e469f3f5aa293016c7d (patch) (unidiff) | |
tree | 8b421d5850589c64e6642397819bbf788b6ee1b6 /libkcal/todo.cpp | |
parent | 85bdc33419eef0ffa9f00eb7222944518fe39b6c (diff) | |
download | kdepimpi-6cf5cc7d0b12af6bdc722e469f3f5aa293016c7d.zip kdepimpi-6cf5cc7d0b12af6bdc722e469f3f5aa293016c7d.tar.gz kdepimpi-6cf5cc7d0b12af6bdc722e469f3f5aa293016c7d.tar.bz2 |
fix
-rw-r--r-- | libkcal/todo.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 5e6ac22..6a6c137 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -114,48 +114,49 @@ void Todo::saveParents() | |||
114 | { | 114 | { |
115 | if (!relatedTo() ) | 115 | if (!relatedTo() ) |
116 | return; | 116 | return; |
117 | Incidence * inc = relatedTo(); | 117 | Incidence * inc = relatedTo(); |
118 | if ( inc->type() != "Todo" ) | 118 | if ( inc->type() != "Todo" ) |
119 | return; | 119 | return; |
120 | Todo* to = (Todo*)inc; | 120 | Todo* to = (Todo*)inc; |
121 | bool saveTodo = false; | 121 | bool saveTodo = false; |
122 | QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; | 122 | QString file = KGlobalSettings::timeTrackerDir() + "/"+ to->uid() + ".ics"; |
123 | QFileInfo fi ( file ); | 123 | QFileInfo fi ( file ); |
124 | if ( fi.exists() ) { | 124 | if ( fi.exists() ) { |
125 | if ( fi.lastModified () < to->lastModified ()) | 125 | if ( fi.lastModified () < to->lastModified ()) |
126 | saveTodo = true; | 126 | saveTodo = true; |
127 | } else { | 127 | } else { |
128 | saveTodo = true; | 128 | saveTodo = true; |
129 | } | 129 | } |
130 | if ( saveTodo ) { | 130 | if ( saveTodo ) { |
131 | CalendarLocal cal; | 131 | CalendarLocal cal; |
132 | cal.setTimeZoneId( " 00:00 Europe/London(UTC)" ); | 132 | cal.setTimeZoneId( " 00:00 Europe/London(UTC)" ); |
133 | Todo * par = (Todo *) to->clone(); | 133 | Todo * par = (Todo *) to->clone(); |
134 | cal.addIncidence( par ); | 134 | cal.addIncidence( par ); |
135 | ICalFormat format; | 135 | ICalFormat format; |
136 | format.save( &cal, file ); | 136 | format.save( &cal, file ); |
137 | } | 137 | } |
138 | to->saveParents(); | ||
138 | } | 139 | } |
139 | 140 | ||
140 | int Todo::runTime() | 141 | int Todo::runTime() |
141 | { | 142 | { |
142 | if ( !mRunning ) | 143 | if ( !mRunning ) |
143 | return 0; | 144 | return 0; |
144 | return mRunStart.secsTo( QDateTime::currentDateTime() ); | 145 | return mRunStart.secsTo( QDateTime::currentDateTime() ); |
145 | } | 146 | } |
146 | bool Todo::hasRunningSub() | 147 | bool Todo::hasRunningSub() |
147 | { | 148 | { |
148 | if ( mRunning ) | 149 | if ( mRunning ) |
149 | return true; | 150 | return true; |
150 | Incidence *aTodo; | 151 | Incidence *aTodo; |
151 | for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) { | 152 | for (aTodo = mRelations.first(); aTodo; aTodo = mRelations.next()) { |
152 | if ( ((Todo*)aTodo)->hasRunningSub() ) | 153 | if ( ((Todo*)aTodo)->hasRunningSub() ) |
153 | return true; | 154 | return true; |
154 | } | 155 | } |
155 | return false; | 156 | return false; |
156 | } | 157 | } |
157 | Incidence *Todo::clone() | 158 | Incidence *Todo::clone() |
158 | { | 159 | { |
159 | return new Todo(*this); | 160 | return new Todo(*this); |
160 | } | 161 | } |
161 | 162 | ||