summaryrefslogtreecommitdiff
path: root/libopie/todoevent.cpp
Unidiff
Diffstat (limited to 'libopie/todoevent.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/todoevent.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp
index 5537b77..b820150 100644
--- a/libopie/todoevent.cpp
+++ b/libopie/todoevent.cpp
@@ -102,65 +102,65 @@ void ToDoEvent::setDescription(const QString &desc )
102void ToDoEvent::setCategory( const QString &cat ) 102void ToDoEvent::setCategory( const QString &cat )
103{ 103{
104 qWarning("setCategory %s", cat.latin1() ); 104 qWarning("setCategory %s", cat.latin1() );
105 m_category.clear(); 105 m_category.clear();
106 m_category << cat; 106 m_category << cat;
107} 107}
108void ToDoEvent::setPriority(int prio ) 108void ToDoEvent::setPriority(int prio )
109{ 109{
110 m_priority = prio; 110 m_priority = prio;
111} 111}
112void ToDoEvent::setDate( QDate date ) 112void ToDoEvent::setDate( QDate date )
113{ 113{
114 m_date = date; 114 m_date = date;
115} 115}
116bool ToDoEvent::isOverdue( ) 116bool ToDoEvent::isOverdue( )
117{ 117{
118 if( m_hasDate ) 118 if( m_hasDate )
119 return QDate::currentDate() > m_date; 119 return QDate::currentDate() > m_date;
120 return false; 120 return false;
121} 121}
122 122
123/*! 123/*!
124 Returns a richt text string 124 Returns a richt text string
125*/ 125*/
126QString ToDoEvent::richText() const 126QString ToDoEvent::richText() const
127{ 127{
128 QString text; 128 QString text;
129 QStringList catlist; 129 QStringList catlist;
130 130
131 // Description of the todo 131 // Description of the todo
132 if ( !description().isEmpty() ){ 132 if ( !description().isEmpty() ){
133 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; 133 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>";
134 text += Qtopia::escapeString(description() ) + "<br>"; 134 text += Qtopia::escapeString(description() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
135 } 135 }
136 text += "<b>" + QObject::tr( "Priority:") +" </b>" 136 text += "<b>" + QObject::tr( "Priority:") +" </b>"
137 + QString::number( priority() ) + "<br>"; 137 + QString::number( priority() ) + "<br>";
138 if (hasDate() ){ 138 if (hasDate() ){
139 text += "<b>" + QObject::tr( "Deadline:") + " </b>"; 139 text += "<b>" + QObject::tr( "Deadline:") + " </b>";
140 text += date().toString(); 140 text += date().toString();
141 text += "<br>"; 141 text += "<br>";
142 } 142 }
143 143
144 // Open database of all categories and get the list of 144 // Open database of all categories and get the list of
145 // the categories this todoevent belongs to. 145 // the categories this todoevent belongs to.
146 // Then print them... 146 // Then print them...
147 // I am not sure whether there is no better way doing this !? 147 // I am not sure whether there is no better way doing this !?
148 Categories catdb; 148 Categories catdb;
149 catdb.load( categoryFileName() ); 149 catdb.load( categoryFileName() );
150 catlist = allCategories(); 150 catlist = allCategories();
151 151
152 text += "<b>" + QObject::tr( "Category:") + "</b> "; 152 text += "<b>" + QObject::tr( "Category:") + "</b> ";
153 for ( QStringList::Iterator it = catlist.begin(); it != catlist.end(); ++it ) { 153 for ( QStringList::Iterator it = catlist.begin(); it != catlist.end(); ++it ) {
154 text += catdb.label ("todo", (*it).toInt()); 154 text += catdb.label ("todo", (*it).toInt());
155 } 155 }
156 text += "<br>"; 156 text += "<br>";
157 return text; 157 return text;
158} 158}
159 159
160bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{ 160bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{
161 if( !hasDate() && !toDoEvent.hasDate() ) return true; 161 if( !hasDate() && !toDoEvent.hasDate() ) return true;
162 if( !hasDate() && toDoEvent.hasDate() ) return true; 162 if( !hasDate() && toDoEvent.hasDate() ) return true;
163 if( hasDate() && toDoEvent.hasDate() ){ 163 if( hasDate() && toDoEvent.hasDate() ){
164 if( date() == toDoEvent.date() ){ // let's the priority decide 164 if( date() == toDoEvent.date() ){ // let's the priority decide
165 return priority() < toDoEvent.priority(); 165 return priority() < toDoEvent.priority();
166 }else{ 166 }else{