summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/otodo.cpp
authorzecke <zecke>2002-09-21 15:02:50 (UTC)
committer zecke <zecke>2002-09-21 15:02:50 (UTC)
commite6c53c4d7317e766235449535b22d0d2fe709214 (patch) (side-by-side diff)
treec210c639611acd5aa3c1863451fb4e31ac3af29a /libopie2/opiepim/otodo.cpp
parentfe0806def8ec79815832193fe402c75361108622 (diff)
downloadopie-e6c53c4d7317e766235449535b22d0d2fe709214.zip
opie-e6c53c4d7317e766235449535b22d0d2fe709214.tar.gz
opie-e6c53c4d7317e766235449535b22d0d2fe709214.tar.bz2
Some more implementation
in OPimRecord::setUid ORecordList implemented never compiled it though OTodo a new c'tor and some more changes
Diffstat (limited to 'libopie2/opiepim/otodo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/otodo.cpp52
1 files changed, 38 insertions, 14 deletions
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp
index 3c93838..8239ba6 100644
--- a/libopie2/opiepim/otodo.cpp
+++ b/libopie2/opiepim/otodo.cpp
@@ -24,7 +24,6 @@ struct OTodo::OTodoData : public QShared {
bool isCompleted:1;
bool hasDate:1;
int priority;
- QStringList category;
QString desc;
QString sum;
QMap<QString, QString> extra;
@@ -46,7 +45,27 @@ OTodo::~OTodo() {
data = 0l;
}
}
+OTodo::OTodo(bool completed, int priority,
+ const QArray<int> &category,
+ const QString& summary,
+ const QString &description,
+ ushort progress,
+ bool hasDate, QDate date, int uid )
+ : OPimRecord( uid )
+{
+ //qWarning("OTodoData");
+ setCategories( category );
+ data = new OTodoData;
+ data->date = date;
+ data->isCompleted = completed;
+ data->hasDate = hasDate;
+ data->priority = priority;
+ data->sum = summary;
+ data->prog = progress;
+ data->desc = Qtopia::simplifyMultiLineSpace(description );
+ data->hasAlarmDateTime = false;
+}
OTodo::OTodo(bool completed, int priority,
const QStringList &category,
const QString& summary,
@@ -267,19 +286,19 @@ bool OTodo::operator>=(const OTodo &toDoEvent )const
}
bool OTodo::operator==(const OTodo &toDoEvent )const
{
- if( data->priority == toDoEvent.data->priority &&
- data->priority == toDoEvent.data->prog &&
- data->isCompleted == toDoEvent.data->isCompleted &&
- data->hasDate == toDoEvent.data->hasDate &&
- data->date == toDoEvent.data->date &&
- data->category == toDoEvent.data->category &&
- data->sum == toDoEvent.data->sum &&
- data->desc == toDoEvent.data->desc &&
- data->hasAlarmDateTime == toDoEvent.data->hasAlarmDateTime &&
- data->alarmDateTime == toDoEvent.data->alarmDateTime )
- return true;
-
+ if ( data->priority != toDoEvent.data->priority ) return false;
+ if ( data->priority != toDoEvent.data->prog ) return false;
+ if ( data->isCompleted != toDoEvent.data->isCompleted ) return false;
+ if ( data->hasDate != toDoEvent.data->hasDate ) return false;
+ if ( data->date != toDoEvent.data->date ) return false;
+ if ( data->sum != toDoEvent.data->sum ) return false;
+ if ( data->desc != toDoEvent.data->desc ) return false;
+ if ( data->hasAlarmDateTime != toDoEvent.data->hasAlarmDateTime )
+ return false;
+ if ( data->alarmDateTime != toDoEvent.data->alarmDateTime )
return false;
+
+ return OPimRecord::operator==( toDoEvent );
}
void OTodo::deref() {
@@ -350,5 +369,10 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) {
dest->hasAlarmDateTime = src->hasAlarmDateTime;
dest->alarmDateTime = src->alarmDateTime;
}
-
+QString OTodo::type() const {
+ return QString::fromLatin1("OTodo");
+}
+QString OTodo::recordField(int id )const {
+ return QString::null;
+}