-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 @@ -13,46 +13,43 @@ * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #include "today.h" #include <qpe/timestring.h> #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> -//#include <qpe/qprocess.h> #include <qpe/resource.h> #include <qpe/contact.h> #include <qpe/global.h> #include <qpe/qpeapplication.h> #include <qdir.h> #include <qfile.h> #include <qdatetime.h> #include <qtextstream.h> #include <qcheckbox.h> #include <qspinbox.h> #include <qpushbutton.h> #include <qlabel.h> #include <qtimer.h> #include <qpixmap.h> -//#include <qfileinfo.h> #include <qlayout.h> #include <qtl.h> -//#include <iostream.h> #include <unistd.h> #include <stdlib.h> int MAX_LINES_TASK; int MAX_CHAR_CLIP; int MAX_LINES_MEET; int SHOW_LOCATION; int SHOW_NOTES; // show only later dates int ONLY_LATER; int AUTOSTART; int NEW_START=1; @@ -375,44 +372,53 @@ void Today::getMail() { void Today::getTodo() { QString output; QString tmpout; int count = 0; int ammount = 0; // get overdue todos first QValueList<ToDoEvent> overDueList = todo->overDue(); qBubbleSort(overDueList); for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin(); it!=overDueList.end(); ++it ) { - if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) { - tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>"; - ammount++; - } + if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) { + QString desc = (*it).summary(); + if( desc.isEmpty() ) { + desc = (*it).description(); + } + tmpout += "<font color=#e00000><b>-" + desc.mid(0, MAX_CHAR_CLIP) + "</b></font><br>"; + + ammount++; + } } // get total number of still open todos QValueList<ToDoEvent> openTodo = todo->rawToDos(); qBubbleSort(openTodo); for ( QValueList<ToDoEvent>::Iterator it=openTodo.begin(); it!=openTodo.end(); ++it ) { - if (!(*it).isCompleted()){ - count +=1; - // not the overdues, we allready got them, and not if we are - // over the maxlines - if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { - tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; - ammount++; + if (!(*it).isCompleted()){ + count +=1; + // not the overdues, we allready got them, and not if we are + // over the maxlines + if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { + QString desc = (*it).summary(); + if( desc.isEmpty() ) { + desc = (*it).description(); + } + tmpout += "<b>-</b>" + desc.mid(0, MAX_CHAR_CLIP) + "<br>"; + ammount++; + } } - } } if (count > 0) { if( count == 1 ) { output = tr("There is <b> 1</b> active task: <br>" ); } else { output = tr("There are <b> %1</b> active tasks: <br>").arg(count); } output += tmpout; } else { output = tr("No active tasks"); @@ -435,26 +441,26 @@ extern QPEApplication *todayApp; void Today::editCard() { startAddressbook(); while( !QCopChannel::isRegistered("QPE/Addressbook")) todayApp->processEvents(); QCopEnvelope v("QPE/Addressbook", "editPersonalAndClose()"); } /* * launches datebook */ void Today::startDatebook() { - QCopEnvelope e("QPE/System", "execute(QString)"); - e << QString("datebook"); + QCopEnvelope e("QPE/System", "execute(QString)"); + e << QString("datebook"); } /* * starts the edit dialog as known from datebook */ void Today::editEvent(const Event &e) { startDatebook(); while(!QCopChannel::isRegistered("QPE/Datebook")) todayApp->processEvents(); QCopEnvelope env("QPE/Datebook", "editEvent(int)"); env << e.uid(); } |