summaryrefslogtreecommitdiff
path: root/core/pim/today/today.cpp
Unidiff
Diffstat (limited to 'core/pim/today/today.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 0f4cbdb..4368201 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -73,26 +73,26 @@ Today::Today( QWidget* parent, const char* name, WFlags fl )
73#if !defined(QT_NO_COP) 73#if !defined(QT_NO_COP)
74 QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this ); 74 QCopChannel *todayChannel = new QCopChannel("QPE/Today" , this );
75 connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)), 75 connect (todayChannel, SIGNAL( received(const QCString &, const QByteArray &)),
76 this, SLOT ( channelReceived(const QCString &, const QByteArray &)) ); 76 this, SLOT ( channelReceived(const QCString &, const QByteArray &)) );
77#endif 77#endif
78#endif 78#endif
79 79
80 80
81 81
82 db = NULL; 82 db = NULL;
83 setOwnerField(); 83 setOwnerField();
84 todo = new ToDoDB; 84 todo = new ToDoDB;
85 getTodo();
86 draw(); 85 draw();
86 getTodo();
87 autoStart(); 87 autoStart();
88} 88}
89 89
90/* 90/*
91 * Qcop receive method. 91 * Qcop receive method.
92 */ 92 */
93void Today::channelReceived(const QCString &msg, const QByteArray & data) { 93void Today::channelReceived(const QCString &msg, const QByteArray & data) {
94 QDataStream stream(data, IO_ReadOnly ); 94 QDataStream stream(data, IO_ReadOnly );
95 if ( msg == "message(QString)" ) { 95 if ( msg == "message(QString)" ) {
96 QString message; 96 QString message;
97 stream >> message; 97 stream >> message;
98 setOwnerField(message); 98 setOwnerField(message);
@@ -145,25 +145,25 @@ void Today::autoStart() {
145 } 145 }
146} 146}
147 147
148/* 148/*
149 * Repaint method. Reread all fields. 149 * Repaint method. Reread all fields.
150 */ 150 */
151void Today::draw() { 151void Today::draw() {
152 init(); 152 init();
153 getDates(); 153 getDates();
154 getMail(); 154 getMail();
155 155
156 // if the todolist.xml file was not modified in between, do not parse it. 156 // if the todolist.xml file was not modified in between, do not parse it.
157 if (checkIfModified()) { 157 if (checkIfModified() || NEW_START==1) {
158 if (todo) delete todo; 158 if (todo) delete todo;
159 todo = new ToDoDB; 159 todo = new ToDoDB;
160 getTodo(); 160 getTodo();
161 } 161 }
162 162
163 // how often refresh 163 // how often refresh
164 QTimer::singleShot( 20*1000, this, SLOT(draw() ) ); 164 QTimer::singleShot( 20*1000, this, SLOT(draw() ) );
165} 165}
166 166
167/* 167/*
168 * Check if the todolist.xml was modified (if there are new entries. 168 * Check if the todolist.xml was modified (if there are new entries.
169 * Returns true if it was modified. 169 * Returns true if it was modified.
@@ -380,28 +380,28 @@ void Today::getTodo() {
380 // get overdue todos first 380 // get overdue todos first
381 QValueList<ToDoEvent> overDueList = todo->overDue(); 381 QValueList<ToDoEvent> overDueList = todo->overDue();
382 qBubbleSort(overDueList); 382 qBubbleSort(overDueList);
383 for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin(); 383 for ( QValueList<ToDoEvent>::Iterator it=overDueList.begin();
384 it!=overDueList.end(); ++it ) { 384 it!=overDueList.end(); ++it ) {
385 if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) { 385 if (!(*it).isCompleted() && ( ammount < MAX_LINES_TASK) ) {
386 tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>"; 386 tmpout += "<font color=#e00000><b>-" +((*it).description()).mid(0, MAX_CHAR_CLIP) + "</b></font><br>";
387 ammount++; 387 ammount++;
388 } 388 }
389 } 389 }
390 390
391 // get total number of still open todos 391 // get total number of still open todos
392 QValueList<ToDoEvent> open = todo->rawToDos(); 392 QValueList<ToDoEvent> openTodo = todo->rawToDos();
393 qBubbleSort(open); 393 qBubbleSort(openTodo);
394 for ( QValueList<ToDoEvent>::Iterator it=open.begin(); 394 for ( QValueList<ToDoEvent>::Iterator it=openTodo.begin();
395 it!=open.end(); ++it ) { 395 it!=openTodo.end(); ++it ) {
396 if (!(*it).isCompleted()){ 396 if (!(*it).isCompleted()){
397 count +=1; 397 count +=1;
398 // not the overdues, we allready got them, and not if we are 398 // not the overdues, we allready got them, and not if we are
399 // over the maxlines 399 // over the maxlines
400 if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) { 400 if (!(*it).isOverdue() && ( ammount < MAX_LINES_TASK) ) {
401 tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>"; 401 tmpout += "<b>-</b>" + ((*it).description()).mid(0, MAX_CHAR_CLIP) + "<br>";
402 ammount++; 402 ammount++;
403 } 403 }
404 } 404 }
405 } 405 }
406 406
407 407