-rw-r--r-- | core/pim/today/today.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp index 69bcb68..d10082f 100644 --- a/core/pim/today/today.cpp +++ b/core/pim/today/today.cpp @@ -310,169 +310,168 @@ QList<TodoItem> Today::loadTodo(const char *filename) { return loadtodolist; } void Today::getMail() { Config cfg("opiemail"); cfg.setGroup("today"); // how many lines should be showed in the task section int NEW_MAILS = cfg.readNumEntry("newmails",0); int OUTGOING = cfg.readNumEntry("outgoing",0); QString output = tr("<b>%1</b> new mail(s), <b>%2</b> outgoing").arg(NEW_MAILS).arg(OUTGOING); MailField->setText(output); } /* * Get the todos * */ void Today::getTodo() { // if the todolist.xml file was not modified in between, do not parse it. if (!checkIfModified() && !NEW_START) { return; } NEW_START=0; QString output; QString tmpout; int count = 0; QDir dir; QString homedir = dir.homeDirPath (); // see if todolist.xml does exist. QFile f(homedir +"/Applications/todolist/todolist.xml"); if ( f.exists() ) { QList<TodoItem> todolist = loadTodo(homedir +"/Applications/todolist/todolist.xml"); TodoItem *item; for( item = todolist.first(); item; item = todolist.next()) { if (!(item->getCompleted() == 1) ) { count++; if (count <= MAX_LINES_TASK) { tmpout += "<b>- </b>" + QString(((item)->getDescription().mid(0, MAX_CHAR_CLIP) + ("<br>"))); } } } } 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"); } TodoField->setText(tr(output)); } /* * launches datebook */ void Today::startDatebook() { QCopEnvelope e("QPE/System", "execute(QString)"); e << QString("datebook"); } /* * launches todolist */ void Today::startTodo() { QCopEnvelope e("QPE/System", "execute(QString)"); e << QString("todolist"); } /* * launch opiemail */ void Today::startMail() { QCopEnvelope e("QPE/System", "execute(QString)"); e << QString("opiemail"); } /* * Destroys the object and frees any allocated resources */ Today::~Today() { // no need to delete child widgets, Qt does it all for us } DateBookEvent::DateBookEvent(const EffectiveEvent &ev, QWidget* parent = 0, const char* name = 0, WFlags fl = 0) : ClickableLabel(parent,name,fl), event(ev) { QString msg; QTime time = QTime::currentTime(); if (!ONLY_LATER) { msg += "<B>" + (ev).description() + "</B>"; if ( (ev).event().hasAlarm() ) { msg += " <b>[with alarm]</b>"; } // include location or not if (SHOW_LOCATION == 1) { msg += "<BR><i>" + (ev).location(); msg += "</i>"; } if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { msg += "<br>All day"; } else { // start time of event msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) ) // end time of event + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) ); } - msg += "<BR>"; // include possible note or not if (SHOW_NOTES == 1) { - msg += " <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; + msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; } } else if ((time.toString() <= TimeString::dateString((ev).event().end())) ) { msg += "<B>" + (ev).description() + "</B>"; if ( (ev).event().hasAlarm() ) { msg += " <b>[with alarm]</b>"; } // include location or not if (SHOW_LOCATION == 1) { - msg+= "<BR><i>" + (ev).location(); + msg += "<BR><i>" + (ev).location(); msg += "</i>"; } if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { msg += "<br>All day"; } else { // start time of event msg += "<br>" + TimeString::timeString(QTime((ev).event().start().time()) ) // end time of event + "<b> - </b>" + TimeString::timeString(QTime((ev).event().end().time()) ); } // include possible note or not if (SHOW_NOTES == 1) { msg += "<br> <i>note</i>:" +((ev).notes()).mid(0, MAX_CHAR_CLIP) + "<br>"; } } setText(msg); connect(this, SIGNAL(clicked()), this, SLOT(editMe())); setAlignment( int( QLabel::WordBreak | QLabel::AlignLeft ) ); } void DateBookEvent::editMe() { emit editEvent(event.event()); } |