summaryrefslogtreecommitdiff
path: root/libopie/todoevent.cpp
Side-by-side diff
Diffstat (limited to 'libopie/todoevent.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie/todoevent.cpp35
1 files changed, 32 insertions, 3 deletions
diff --git a/libopie/todoevent.cpp b/libopie/todoevent.cpp
index aa348a2..fb7073c 100644
--- a/libopie/todoevent.cpp
+++ b/libopie/todoevent.cpp
@@ -16,16 +16,20 @@ ToDoEvent::ToDoEvent(const ToDoEvent &event )
{
*this = 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;
m_isCompleted = completed;
m_hasDate = hasDate;
m_priority = priority;
m_category = category;
+ m_sum = summary;
m_desc = Qtopia::simplifyMultiLineSpace(description );
if (uid == -1 ) {
Qtopia::UidGen *uidgen = new Qtopia::UidGen();
uid = uidgen->generate();
@@ -65,8 +69,16 @@ int ToDoEvent::priority()const
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 )
{
m_category.append( str );
}
@@ -98,8 +110,16 @@ void ToDoEvent::setHasDate( bool hasDate )
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 )
{
qWarning("setCategory %s", cat.latin1() );
m_category.clear();
@@ -129,8 +149,10 @@ QString ToDoEvent::richText() const
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>";
}
text += "<b>" + QObject::tr( "Priority:") +" </b>"
@@ -214,9 +236,15 @@ bool ToDoEvent::operator>=(const ToDoEvent &toDoEvent )const
return true;
}
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;
}
ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item )
@@ -227,8 +255,9 @@ ToDoEvent &ToDoEvent::operator=(const ToDoEvent &item )
m_priority = item.m_priority;
m_category = item.m_category;
m_desc = item.m_desc;
m_uid = item.m_uid;
+ m_sum = item.m_sum;
return *this;
}