summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/otodo.cpp
authorzecke <zecke>2002-11-02 12:36:34 (UTC)
committer zecke <zecke>2002-11-02 12:36:34 (UTC)
commitffd0a764e4ac7f9bf29edf3b9b4d341e153ecf4a (patch) (side-by-side diff)
tree601ac645a3768c1fe89fce01243f54a24f08dc15 /libopie2/opiepim/otodo.cpp
parent74f49994a9c19bdfdbfdfb57a5cf5e1a1f966b53 (diff)
downloadopie-ffd0a764e4ac7f9bf29edf3b9b4d341e153ecf4a.zip
opie-ffd0a764e4ac7f9bf29edf3b9b4d341e153ecf4a.tar.gz
opie-ffd0a764e4ac7f9bf29edf3b9b4d341e153ecf4a.tar.bz2
Fix a vCard problem in OContact
cell phones do not set the UId property... add some more states to otodo
Diffstat (limited to 'libopie2/opiepim/otodo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/otodo.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/libopie2/opiepim/otodo.cpp b/libopie2/opiepim/otodo.cpp
index 765d5a9..0d5b1d3 100644
--- a/libopie2/opiepim/otodo.cpp
+++ b/libopie2/opiepim/otodo.cpp
@@ -9,13 +9,14 @@
#include <qpe/palmtoprecord.h>
#include <qpe/stringutil.h>
#include <qpe/categories.h>
#include <qpe/categoryselect.h>
-
+#include "opimstate.h"
+#include "orecur.h"
#include "otodo.h"
struct OTodo::OTodoData : public QShared {
OTodoData() : QShared() {
};
@@ -27,12 +28,14 @@ struct OTodo::OTodoData : public QShared {
QString desc;
QString sum;
QMap<QString, QString> extra;
ushort prog;
bool hasAlarmDateTime :1;
QDateTime alarmDateTime;
+ OPimState state;
+ ORecur recur;
};
OTodo::OTodo(const OTodo &event )
: OPimRecord( event ), data( event.data )
{
data->ref();
@@ -141,12 +144,18 @@ QDateTime OTodo::alarmDateTime() const
}
QString OTodo::description()const
{
return data->desc;
}
+OPimState OTodo::state()const {
+ return data->state;
+}
+ORecur OTodo::recurrence()const {
+ return data->recur;
+}
void OTodo::setCompleted( bool completed )
{
changeOrModify();
data->isCompleted = completed;
}
void OTodo::setHasDueDate( bool hasDate )
@@ -182,12 +191,20 @@ void OTodo::setDueDate( QDate date )
}
void OTodo::setAlarmDateTime( const QDateTime& alarm )
{
changeOrModify();
data->alarmDateTime = alarm;
}
+void OTodo::setState( const OPimState& state ) {
+ changeOrModify();
+ data->state = state;
+}
+void OTodo::setRecurrence( const ORecur& rec) {
+ changeOrModify();
+ data->recur = rec;
+}
bool OTodo::isOverdue( )
{
if( data->hasDate && !data->isCompleted)
return QDate::currentDate() > data->date;
return false;
}
@@ -355,13 +372,13 @@ QMap<QString, QString> OTodo::toExtraMap()const {
* change or modify looks at the ref count and either
* creates a new QShared Object or it can modify it
* right in place
*/
void OTodo::changeOrModify() {
if ( data->count != 1 ) {
-// qWarning("changeOrModify");
+ qWarning("changeOrModify");
data->deref();
OTodoData* d2 = new OTodoData();
copy(data, d2 );
data = d2;
}
}
@@ -373,12 +390,14 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) {
dest->desc = src->desc;
dest->sum = src->sum;
dest->extra = src->extra;
dest->prog = src->prog;
dest->hasAlarmDateTime = src->hasAlarmDateTime;
dest->alarmDateTime = src->alarmDateTime;
+ dest->state = src->state;
+ dest->recur = src->recur;
}
QString OTodo::type() const {
return QString::fromLatin1("OTodo");
}
QString OTodo::recordField(int id )const {
return QString::null;