summaryrefslogtreecommitdiff
authorzecke <zecke>2002-05-09 15:39:38 (UTC)
committer zecke <zecke>2002-05-09 15:39:38 (UTC)
commit7999411de407eaaf57cae9e2d0cb3767c714d161 (patch) (unidiff)
treea29d0744a5aa698c8eb329721d1df651096eeb10
parent543122f38cc6e2b711d4afa321f7fed469b76621 (diff)
downloadopie-7999411de407eaaf57cae9e2d0cb3767c714d161.zip
opie-7999411de407eaaf57cae9e2d0cb3767c714d161.tar.gz
opie-7999411de407eaaf57cae9e2d0cb3767c714d161.tar.bz2
Patch from Stefan Eilers to separate multiple categories by a ,
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/todoevent.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp
index b820150..aa348a2 100644
--- a/libopie/todoevent.cpp
+++ b/libopie/todoevent.cpp
@@ -125,53 +125,58 @@ bool ToDoEvent::isOverdue( )
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() ).replace(QRegExp( "[\n]"), "<br>" ) + "<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 bool firstloop = true;
149 catdb.load( categoryFileName() ); 150 catdb.load( categoryFileName() );
150 catlist = allCategories(); 151 catlist = allCategories();
151 152
152 text += "<b>" + QObject::tr( "Category:") + "</b> "; 153 text += "<b>" + QObject::tr( "Category:") + "</b> ";
153 for ( QStringList::Iterator it = catlist.begin(); it != catlist.end(); ++it ) { 154 for ( QStringList::Iterator it = catlist.begin(); it != catlist.end(); ++it ) {
155 if (!firstloop){
156 text += ", ";
157 }
158 firstloop = false;
154 text += catdb.label ("todo", (*it).toInt()); 159 text += catdb.label ("todo", (*it).toInt());
155 } 160 }
156 text += "<br>"; 161 text += "<br>";
157 return text; 162 return text;
158} 163}
159 164
160bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{ 165bool ToDoEvent::operator<( const ToDoEvent &toDoEvent )const{
161 if( !hasDate() && !toDoEvent.hasDate() ) return true; 166 if( !hasDate() && !toDoEvent.hasDate() ) return true;
162 if( !hasDate() && toDoEvent.hasDate() ) return true; 167 if( !hasDate() && toDoEvent.hasDate() ) return true;
163 if( hasDate() && toDoEvent.hasDate() ){ 168 if( hasDate() && toDoEvent.hasDate() ){
164 if( date() == toDoEvent.date() ){ // let's the priority decide 169 if( date() == toDoEvent.date() ){ // let's the priority decide
165 return priority() < toDoEvent.priority(); 170 return priority() < toDoEvent.priority();
166 }else{ 171 }else{
167 return date() < toDoEvent.date(); 172 return date() < toDoEvent.date();
168 } 173 }
169 } 174 }
170 return false; 175 return false;
171} 176}
172bool ToDoEvent::operator<=(const ToDoEvent &toDoEvent )const 177bool ToDoEvent::operator<=(const ToDoEvent &toDoEvent )const
173{ 178{
174 if( !hasDate() && !toDoEvent.hasDate() ) return true; 179 if( !hasDate() && !toDoEvent.hasDate() ) return true;
175 if( !hasDate() && toDoEvent.hasDate() ) return true; 180 if( !hasDate() && toDoEvent.hasDate() ) return true;
176 if( hasDate() && toDoEvent.hasDate() ){ 181 if( hasDate() && toDoEvent.hasDate() ){
177 if( date() == toDoEvent.date() ){ // let's the priority decide 182 if( date() == toDoEvent.date() ){ // let's the priority decide