summaryrefslogtreecommitdiff
path: root/libopie/todoevent.cpp
Side-by-side diff
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
@@ -18,6 +18,9 @@ ToDoEvent::ToDoEvent(const ToDoEvent &event )
}
-ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category,
- const QString &description, bool hasDate, QDate date, int uid )
+ToDoEvent::ToDoEvent(bool completed, int priority,
+ const QStringList &category,
+ const QString& summary,
+ const QString &description,
+ bool hasDate, QDate date, int uid )
{
m_date = date;
@@ -26,4 +29,5 @@ ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category,
m_priority = priority;
m_category = category;
+ m_sum = summary;
m_desc = Qtopia::simplifyMultiLineSpace(description );
if (uid == -1 ) {
@@ -32,5 +36,5 @@ ToDoEvent::ToDoEvent(bool completed, int priority, const QStringList &category,
delete uidgen;
}// generate the ids
- m_uid = uid;
+ m_uid = uid;
}
QArray<int> ToDoEvent::categories()const
@@ -67,4 +71,12 @@ QStringList ToDoEvent::allCategories()const
return m_category;
}
+QString ToDoEvent::extra(const QString& )const
+{
+ return QString::null;
+}
+QString ToDoEvent::summary() const
+{
+ return m_sum;
+}
void ToDoEvent::insertCategory(const QString &str )
{
@@ -100,4 +112,12 @@ void ToDoEvent::setDescription(const QString &desc )
m_desc = Qtopia::simplifyMultiLineSpace(desc );
}
+void ToDoEvent::setExtra( const QString&, const QString& )
+{
+
+}
+void ToDoEvent::setSummary( const QString& sum )
+{
+ m_sum = sum;
+}
void ToDoEvent::setCategory( const QString &cat )
{
@@ -128,7 +148,9 @@ QString ToDoEvent::richText() const
QString text;
QStringList catlist;
-
+
// Description of the todo
if ( !description().isEmpty() ){
+ text += "<b>" + QObject::tr( "Summary:") + "</b><br>";
+ 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>";
@@ -141,5 +163,5 @@ QString ToDoEvent::richText() const
text += "<br>";
}
-
+
// Open database of all categories and get the list of
// the categories this todoevent belongs to.
@@ -150,5 +172,5 @@ QString ToDoEvent::richText() const
catdb.load( categoryFileName() );
catlist = allCategories();
-
+
text += "<b>" + QObject::tr( "Category:") + "</b> ";
for ( QStringList::Iterator it = catlist.begin(); it != catlist.end(); ++it ) {
@@ -216,5 +238,11 @@ bool ToDoEvent::operator>=(const ToDoEvent &toDoEvent )const
bool ToDoEvent::operator==(const ToDoEvent &toDoEvent )const
{
- 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 )
+ if( m_priority == toDoEvent.m_priority &&
+ m_isCompleted == toDoEvent.m_isCompleted &&
+ m_hasDate == toDoEvent.m_hasDate &&
+ m_date == toDoEvent.m_date &&
+ m_category == toDoEvent.m_category &&
+ m_sum == toDoEvent.m_sum &&
+ m_desc == toDoEvent.m_desc )
return true;
return false;
@@ -229,4 +257,5 @@ ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item )
m_desc = item.m_desc;
m_uid = item.m_uid;
+ m_sum = item.m_sum;
return *this;
}