-rw-r--r-- | libopie/todoevent.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp index fb7073c..b35ac9d 100644 --- a/libopie/todoevent.cpp +++ b/libopie/todoevent.cpp @@ -22,4 +22,5 @@ ToDoEvent::ToDoEvent(bool completed, int priority, const QString& summary, const QString &description, + ushort progress, bool hasDate, QDate date, int uid ) { @@ -30,4 +31,5 @@ ToDoEvent::ToDoEvent(bool completed, int priority, m_category = category; m_sum = summary; + m_prog = progress; m_desc = Qtopia::simplifyMultiLineSpace(description ); if (uid == -1 ) { @@ -79,4 +81,8 @@ QString ToDoEvent::summary() const return m_sum; } +ushort ToDoEvent::progress() const +{ + return m_prog; +} void ToDoEvent::insertCategory(const QString &str ) { @@ -140,5 +146,8 @@ bool ToDoEvent::isOverdue( ) return false; } - +void ToDoEvent::setProgress(ushort progress ) +{ + m_prog = progress; +} /*! Returns a richt text string @@ -154,8 +163,10 @@ QString ToDoEvent::richText() const text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; - text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>"; + text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br><br><br>"; } text += "<b>" + QObject::tr( "Priority:") +" </b>" - + QString::number( priority() ) + "<br>"; + + QString::number( priority() ) + " <br>"; + text += "<b>" + QObject::tr( "Progress:") + " </b>" + + QString::number( progress() ) + " %<br>"; if (hasDate() ){ text += "<b>" + QObject::tr( "Deadline:") + " </b>"; @@ -187,5 +198,5 @@ QString ToDoEvent::richText() const bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{ if( !hasDate() && !toDoEvent.hasDate() ) return true; - if( !hasDate() && toDoEvent.hasDate() ) return true; + if( !hasDate() && toDoEvent.hasDate() ) return false; if( hasDate() && toDoEvent.hasDate() ){ if( date() == toDoEvent.date() ){ // let's the priority decide @@ -239,4 +250,5 @@ bool ToDoEvent::operator==(const ToDoEvent &toDoEvent )const { if( m_priority == toDoEvent.m_priority && + m_priority == toDoEvent.m_prog && m_isCompleted == toDoEvent.m_isCompleted && m_hasDate == toDoEvent.m_hasDate && @@ -258,4 +270,5 @@ ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item ) m_uid = item.m_uid; m_sum = item.m_sum; + m_prog = item.m_prog; return *this; } |