author | harlekin <harlekin> | 2002-06-27 14:33:51 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-27 14:33:51 (UTC) |
commit | 63d7fd9b233a5b6a9e3670b6ef1c09a2e87ffa42 (patch) (unidiff) | |
tree | e5c81e0728f394fba918f9e71cbacd33de870aee | |
parent | 540fd6a4a7cc86070c94f41833c4b9b9fa0e9824 (diff) | |
download | opie-63d7fd9b233a5b6a9e3670b6ef1c09a2e87ffa42.zip opie-63d7fd9b233a5b6a9e3670b6ef1c09a2e87ffa42.tar.gz opie-63d7fd9b233a5b6a9e3670b6ef1c09a2e87ffa42.tar.bz2 |
should fix bug #83
-rw-r--r-- | core/pim/today/today.cpp | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index ad1ec90..62becb0 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp | |||
@@ -21,9 +21,8 @@ | |||
21 | 21 | ||
22 | #include <qpe/timestring.h> | 22 | #include <qpe/timestring.h> |
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | #include <qpe/qcopenvelope_qws.h> | 24 | #include <qpe/qcopenvelope_qws.h> |
25 | //#include <qpe/qprocess.h> | ||
26 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
27 | #include <qpe/contact.h> | 26 | #include <qpe/contact.h> |
28 | #include <qpe/global.h> | 27 | #include <qpe/global.h> |
29 | #include <qpe/qpeapplication.h> | 28 | #include <qpe/qpeapplication.h> |
@@ -37,14 +36,12 @@ | |||
37 | #include <qpushbutton.h> | 36 | #include <qpushbutton.h> |
38 | #include <qlabel.h> | 37 | #include <qlabel.h> |
39 | #include <qtimer.h> | 38 | #include <qtimer.h> |
40 | #include <qpixmap.h> | 39 | #include <qpixmap.h> |
41 | //#include <qfileinfo.h> | ||
42 | #include <qlayout.h> | 40 | #include <qlayout.h> |
43 | #include <qtl.h> | 41 | #include <qtl.h> |
44 | 42 | ||
45 | 43 | ||
46 | //#include <iostream.h> | ||
47 | #include <unistd.h> | 44 | #include <unistd.h> |
48 | #include <stdlib.h> | 45 | #include <stdlib.h> |
49 | 46 | ||
50 | int MAX_LINES_TASK; | 47 | int MAX_LINES_TASK; |
@@ -383,28 +380,37 @@ void Today::getTodo() { | |||
383 | QValueList<ToDoEvent> overDueList = todo->overDue(); | 380 | QValueList<ToDoEvent> overDueList = todo->overDue(); |
384 | qBubbleSort(overDueList); | 381 | qBubbleSort(overDueList); |
385 | for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin(); | 382 | for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin(); |
386 | it!=overDueList.end(); ++it ) { | 383 | it!=overDueList.end(); ++it ) { |
387 | if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) { | 384 | if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) { |
388 | tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>"; | 385 | QString desc = (*it).summary(); |
389 | ammount++; | 386 | if( desc.isEmpty() ) { |
390 | } | 387 | desc = (*it).description(); |
388 | } | ||
389 | tmpout += "<font color=#e00000><b>-" + desc.mid(0, MAX_CHAR_CLIP) + "</b></font><br>"; | ||
390 | |||
391 | ammount++; | ||
392 | } | ||
391 | } | 393 | } |
392 | 394 | ||
393 | // get total number of still open todos | 395 | // get total number of still open todos |
394 | QValueList<ToDoEvent> openTodo = todo->rawToDos(); | 396 | QValueList<ToDoEvent> openTodo = todo->rawToDos(); |
395 | qBubbleSort(openTodo); | 397 | qBubbleSort(openTodo); |
396 | for ( QValueList<ToDoEvent>::Iterator it=openTodo.begin(); | 398 | for ( QValueList<ToDoEvent>::Iterator it=openTodo.begin(); |
397 | it!=openTodo.end(); ++it ) { | 399 | it!=openTodo.end(); ++it ) { |
398 | if (!(*it).isCompleted()){ | 400 | if (!(*it).isCompleted()){ |
399 | count +=1; | 401 | count +=1; |
400 | // not the overdues, we allready got them, and not if we are | 402 | // not the overdues, we allready got them, and not if we are |
401 | // over the maxlines | 403 | // over the maxlines |
402 | if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { | 404 | if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { |
403 | tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; | 405 | QString desc = (*it).summary(); |
404 | ammount++; | 406 | if( desc.isEmpty() ) { |
407 | desc = (*it).description(); | ||
408 | } | ||
409 | tmpout += "<b>-</b>" + desc.mid(0, MAX_CHAR_CLIP) + "<br>"; | ||
410 | ammount++; | ||
411 | } | ||
405 | } | 412 | } |
406 | } | ||
407 | } | 413 | } |
408 | 414 | ||
409 | 415 | ||
410 | if (count > 0) { | 416 | if (count > 0) { |
@@ -443,10 +449,10 @@ void Today::editCard() { | |||
443 | /* | 449 | /* |
444 | * launches datebook | 450 | * launches datebook |
445 | */ | 451 | */ |
446 | void Today::startDatebook() { | 452 | void Today::startDatebook() { |
447 | QCopEnvelope e("QPE/System", "execute(QString)"); | 453 | QCopEnvelope e("QPE/System", "execute(QString)"); |
448 | e << QString("datebook"); | 454 | e << QString("datebook"); |
449 | } | 455 | } |
450 | 456 | ||
451 | /* | 457 | /* |
452 | * starts the edit dialog as known from datebook | 458 | * starts the edit dialog as known from datebook |