summaryrefslogtreecommitdiff
path: root/libopie/todoevent.cpp
authorzecke <zecke>2002-06-15 16:46:37 (UTC)
committer zecke <zecke>2002-06-15 16:46:37 (UTC)
commitff47b17768607d8819ef5cd3316a1cab0abdcf3a (patch) (unidiff)
treeaddbc4d7d8826ce2952aca872e67e3575d77cda7 /libopie/todoevent.cpp
parent9f41969610f9db5d60d6080abae0b21e54a549e2 (diff)
downloadopie-ff47b17768607d8819ef5cd3316a1cab0abdcf3a.zip
opie-ff47b17768607d8819ef5cd3316a1cab0abdcf3a.tar.gz
opie-ff47b17768607d8819ef5cd3316a1cab0abdcf3a.tar.bz2
Summary support
Diffstat (limited to 'libopie/todoevent.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/todoevent.cpp43
1 files changed, 36 insertions, 7 deletions
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp
index aa348a2..fb7073c 100644
--- a/libopie/todoevent.cpp
+++ b/libopie/todoevent.cpp
@@ -19,4 +19,7 @@ ToDoEvent::ToDoEvent(const ToDoEvent &event )
19 19
20ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category, 20ToDoEvent::ToDoEvent(bool completed, int priority,
21 const QString &description, bool hasDate, QDate date, int uid ) 21 const QStringList &category,
22 const QString& summary,
23 const QString &description,
24 bool hasDate, QDate date, int uid )
22{ 25{
@@ -27,2 +30,3 @@ ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category,
27 m_category = category; 30 m_category = category;
31 m_sum = summary;
28 m_desc = Qtopia::simplifyMultiLineSpace(description ); 32 m_desc = Qtopia::simplifyMultiLineSpace(description );
@@ -33,3 +37,3 @@ ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category,
33 }// generate the ids 37 }// generate the ids
34 m_uid = uid; 38 m_uid = uid;
35} 39}
@@ -68,2 +72,10 @@ QStringList ToDoEvent::allCategories()const
68} 72}
73QString ToDoEvent::extra(const QString& )const
74{
75 return QString::null;
76}
77QString ToDoEvent::summary() const
78{
79 return m_sum;
80}
69void ToDoEvent::insertCategory(const QString &str ) 81void ToDoEvent::insertCategory(const QString &str )
@@ -101,2 +113,10 @@ void ToDoEvent::setDescription(const QString &desc )
101} 113}
114void ToDoEvent::setExtra( const QString&, const QString& )
115{
116
117}
118void ToDoEvent::setSummary( const QString& sum )
119{
120 m_sum = sum;
121}
102void ToDoEvent::setCategory( const QString &cat ) 122void ToDoEvent::setCategory( const QString &cat )
@@ -129,5 +149,7 @@ QString ToDoEvent::richText() const
129 QStringList catlist; 149 QStringList catlist;
130 150
131 // Description of the todo 151 // Description of the todo
132 if ( !description().isEmpty() ){ 152 if ( !description().isEmpty() ){
153 text += "<b>" + QObject::tr( "Summary:") + "</b><br>";
154 text += Qtopia::escapeString(summary() ).replace(QRegExp( "[\n]"), "<br>" ) + "<br>";
133 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>"; 155 text += "<b>" + QObject::tr( "Description:" ) + "</b><br>";
@@ -142,3 +164,3 @@ QString ToDoEvent::richText() const
142 } 164 }
143 165
144 // Open database of all categories and get the list of 166 // Open database of all categories and get the list of
@@ -151,3 +173,3 @@ QString ToDoEvent::richText() const
151 catlist = allCategories(); 173 catlist = allCategories();
152 174
153 text += "<b>" + QObject::tr( "Category:") + "</b> "; 175 text += "<b>" + QObject::tr( "Category:") + "</b> ";
@@ -217,3 +239,9 @@ bool ToDoEvent::operator==(const ToDoEvent &toDoEvent )const
217{ 239{
218 if( m_date == toDoEvent.m_date && m_isCompleted == toDoEvent.m_isCompleted && m_hasDate == toDoEvent.m_hasDate && m_priority == toDoEvent.m_priority && m_category == toDoEvent.m_category && m_desc == toDoEvent.m_desc ) 240 if( m_priority == toDoEvent.m_priority &&
241 m_isCompleted == toDoEvent.m_isCompleted &&
242 m_hasDate == toDoEvent.m_hasDate &&
243 m_date == toDoEvent.m_date &&
244 m_category == toDoEvent.m_category &&
245 m_sum == toDoEvent.m_sum &&
246 m_desc == toDoEvent.m_desc )
219 return true; 247 return true;
@@ -230,2 +258,3 @@ ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item )
230 m_uid = item.m_uid; 258 m_uid = item.m_uid;
259 m_sum = item.m_sum;
231 return *this; 260 return *this;