-rw-r--r-- | core/pim/today/today.cpp | 165 |
1 files changed, 83 insertions, 82 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 0fa7ad5..af1d4e4 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -96,3 +96,4 @@ void Today::init() { | |||
96 | QDate date = QDate::currentDate(); | 96 | QDate date = QDate::currentDate(); |
97 | QString time = (tr( date.toString() ), white); | 97 | QString time = (tr( date.toString()) ); |
98 | // QString time = (tr( date.toString()) , white); | ||
98 | 99 | ||
@@ -188,3 +189,3 @@ void Today::getDates() { | |||
188 | for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); | 189 | for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin(); |
189 | it!=list.end(); ++it ) { | 190 | it!=list.end(); ++it ) { |
190 | 191 | ||
@@ -193,55 +194,55 @@ void Today::getDates() { | |||
193 | if ( count <= MAX_LINES_MEET ) { | 194 | if ( count <= MAX_LINES_MEET ) { |
194 | //cout << time.toString() << endl; | 195 | //cout << time.toString() << endl; |
195 | //cout << TimeString::dateString((*it).event().end()) << endl; | 196 | //cout << TimeString::dateString((*it).event().end()) << endl; |
196 | 197 | ||
197 | // decide if to get all day or only later appointments | 198 | // decide if to get all day or only later appointments |
198 | if (!ONLY_LATER) { | 199 | if (!ONLY_LATER) { |
199 | msg += "<B>" + (*it).description() + "</B>"; | 200 | msg += "<B>" + (*it).description() + "</B>"; |
200 | if ( (*it).event().hasAlarm() ) { | 201 | if ( (*it).event().hasAlarm() ) { |
201 | msg += " <b>[with alarm]</b>"; | 202 | msg += " <b>[with alarm]</b>"; |
202 | } | 203 | } |
203 | // include location or not | 204 | // include location or not |
204 | if (SHOW_LOCATION == 1) { | 205 | if (SHOW_LOCATION == 1) { |
205 | msg += "<BR><i>" + (*it).location(); | 206 | msg += "<BR><i>" + (*it).location(); |
206 | msg += "</i>"; | 207 | msg += "</i>"; |
207 | } | 208 | } |
208 | 209 | ||
209 | if ( (TimeString::timeString(QTime((*it).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((*it).event().end().time()) ) == "23:59") ) { | 210 | if ( (TimeString::timeString(QTime((*it).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((*it).event().end().time()) ) == "23:59") ) { |
210 | msg += "<br>All day"; | 211 | msg += "<br>All day"; |
211 | } else { | 212 | } else { |
212 | // start time of event | 213 | // start time of event |
213 | msg += "<br>" + TimeString::timeString(QTime((*it).event().start().time()) ) | 214 | msg += "<br>" + TimeString::timeString(QTime((*it).event().start().time()) ) |
214 | // end time of event | 215 | // end time of event |
215 | + "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) ); | 216 | + "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) ); |
216 | } | 217 | } |
217 | msg += "<BR>"; | 218 | msg += "<BR>"; |
218 | // include possible note or not | 219 | // include possible note or not |
219 | if (SHOW_NOTES == 1) { | 220 | if (SHOW_NOTES == 1) { |
220 | msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; | 221 | msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; |
221 | } | 222 | } |
222 | } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { | 223 | } else if ((time.toString() <= TimeString::dateString((*it).event().end())) ) { |
223 | msg += "<B>" + (*it).description() + "</B>"; | 224 | msg += "<B>" + (*it).description() + "</B>"; |
224 | if ( (*it).event().hasAlarm() ) { | 225 | if ( (*it).event().hasAlarm() ) { |
225 | msg += " <b>[with alarm]</b>"; | 226 | msg += " <b>[with alarm]</b>"; |
226 | } | 227 | } |
227 | // include location or not | 228 | // include location or not |
228 | if (SHOW_LOCATION == 1) { | 229 | if (SHOW_LOCATION == 1) { |
229 | msg+= "<BR><i>" + (*it).location(); | 230 | msg+= "<BR><i>" + (*it).location(); |
230 | msg += "</i>"; | 231 | msg += "</i>"; |
231 | } | 232 | } |
232 | 233 | ||
233 | if ( (TimeString::timeString(QTime((*it).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((*it).event().end().time()) ) == "23:59") ) { | 234 | if ( (TimeString::timeString(QTime((*it).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((*it).event().end().time()) ) == "23:59") ) { |
234 | msg += "<br>All day"; | 235 | msg += "<br>All day"; |
235 | } else { | 236 | } else { |
236 | // start time of event | 237 | // start time of event |
237 | msg += "<br>" + TimeString::timeString(QTime((*it).event().start().time()) ) | 238 | msg += "<br>" + TimeString::timeString(QTime((*it).event().start().time()) ) |
238 | // end time of event | 239 | // end time of event |
239 | + "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) ); | 240 | + "<b> - </b>" + TimeString::timeString(QTime((*it).event().end().time()) ); |
240 | } | 241 | } |
241 | msg += "<BR>"; | 242 | msg += "<BR>"; |
242 | // include possible note or not | 243 | // include possible note or not |
243 | if (SHOW_NOTES == 1) { | 244 | if (SHOW_NOTES == 1) { |
244 | msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; | 245 | msg += " <i>note</i>:" +((*it).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; |
245 | } | 246 | } |
246 | } | 247 | } |
247 | } | 248 | } |
@@ -284,27 +285,27 @@ QList<TodoItem> Today::loadTodo(const char *filename) { | |||
284 | while((attlist) && (attlist[j])) { | 285 | while((attlist) && (attlist[j])) { |
285 | if(!attlist[j]->name) { | 286 | if(!attlist[j]->name) { |
286 | continue; | 287 | continue; |
287 | } | 288 | } |
288 | if(!strcmp(attlist[j]->name, "Description")) { | 289 | if(!strcmp(attlist[j]->name, "Description")) { |
289 | description = attlist[j]->value; | 290 | description = attlist[j]->value; |
290 | } | 291 | } |
291 | // get Completed tag (0 or 1) | 292 | // get Completed tag (0 or 1) |
292 | if(!strcmp(attlist[j]->name, "Completed")) { | 293 | if(!strcmp(attlist[j]->name, "Completed")) { |
293 | QString s = attlist[j]->name; | 294 | QString s = attlist[j]->name; |
294 | if(s == "Completed") { | 295 | if(s == "Completed") { |
295 | completed = QString(attlist[j]->value).toInt(); | 296 | completed = QString(attlist[j]->value).toInt(); |
296 | } | 297 | } |
297 | } | 298 | } |
298 | // get Priority (1 to 5) | 299 | // get Priority (1 to 5) |
299 | if(!strcmp(attlist[j]->name, "Priority")) { | 300 | if(!strcmp(attlist[j]->name, "Priority")) { |
300 | QString s = attlist[j]->name; | 301 | QString s = attlist[j]->name; |
301 | if(s == "Priority") { | 302 | if(s == "Priority") { |
302 | priority = QString(attlist[j]->value).toInt(); | 303 | priority = QString(attlist[j]->value).toInt(); |
303 | } | 304 | } |
304 | } | 305 | } |
305 | j++; | 306 | j++; |
306 | } | 307 | } |
307 | if(description) { | 308 | if(description) { |
308 | tmp = new TodoItem(description, completed, priority); | 309 | tmp = new TodoItem(description, completed, priority); |
309 | loadtodolist.append(tmp); | 310 | loadtodolist.append(tmp); |
310 | } | 311 | } |
@@ -355,6 +356,6 @@ void Today::getTodo() { | |||
355 | if (!(item->getCompleted() == 1) ) { | 356 | if (!(item->getCompleted() == 1) ) { |
356 | count++; | 357 | count++; |
357 | if (count <= MAX_LINES_TASK) { | 358 | if (count <= MAX_LINES_TASK) { |
358 | tmpout += "<b>- </b>" + QString(((item)->getDescription().mid(0, MAX_CHAR_CLIP) + ("<br>"))); | 359 | tmpout += "<b>- </b>" + QString(((item)->getDescription().mid(0, MAX_CHAR_CLIP) + ("<br>"))); |
359 | } | 360 | } |
360 | } | 361 | } |