-rw-r--r-- | libopie/todoevent.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp index 4cfe1c0..5fa4472 100644 --- a/libopie/todoevent.cpp +++ b/libopie/todoevent.cpp @@ -1,80 +1,82 @@ #include <opie/todoevent.h> #include <qpe/palmtopuidgen.h> +#include <qpe/stringutil.h> +//#include <qpe/palmtoprecord.h> ToDoEvent::ToDoEvent(bool completed, int priority, const QString &category, const QString &description, bool hasDate, QDate date, int uid ) { qWarning("todoEvent c'tor" ); m_date = date; m_isCompleted = completed; m_hasDate = hasDate; m_priority = priority; m_category = category; - m_desc = description; + m_desc = Qtopia::simplifyMultiLineSpace(description ); if (uid == -1 ) { Qtopia::UidGen *uidgen = new Qtopia::UidGen(); uid = uidgen->generate(); delete uidgen; }// generate the ids m_uid = uid; } bool ToDoEvent::isCompleted() const { return m_isCompleted; } bool ToDoEvent::hasDate() const { return m_hasDate; } int ToDoEvent::priority()const { return m_priority; } QString ToDoEvent::category()const { return m_category; } QDate ToDoEvent::date()const { return m_date; } QString ToDoEvent::description()const { return m_desc; } void ToDoEvent::setCompleted( bool completed ) { m_isCompleted = completed; } void ToDoEvent::setHasDate( bool hasDate ) { m_hasDate = hasDate; } void ToDoEvent::setDescription(const QString &desc ) { - m_desc = desc; + m_desc = Qtopia::simplifyMultiLineSpace(desc ); } void ToDoEvent::setCategory( const QString &cat ) { m_category = cat; } void ToDoEvent::setPriority(int prio ) { m_priority = prio; } void ToDoEvent::setDate( QDate date ) { m_date = date; } bool ToDoEvent::isOverdue( ) { if( m_hasDate ) return QDate::currentDate() > m_date; return false; } bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{ if( !hasDate() && !toDoEvent.hasDate() ) return true; if( !hasDate() && toDoEvent.hasDate() ) return true; if( hasDate() && toDoEvent.hasDate() ){ if( date() == toDoEvent.date() ){ // let's the priority decide |