summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/otodo.cpp
Side-by-side diff
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
@@ -13,5 +13,6 @@
-
+#include "opimstate.h"
+#include "orecur.h"
#include "otodo.h"
@@ -31,4 +32,6 @@ struct OTodo::OTodoData : public QShared {
bool hasAlarmDateTime :1;
QDateTime alarmDateTime;
+ OPimState state;
+ ORecur recur;
};
@@ -145,4 +148,10 @@ 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 )
{
@@ -186,4 +195,12 @@ void OTodo::setAlarmDateTime( const QDateTime& alarm )
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( )
{
@@ -359,5 +376,5 @@ QMap<QString, QString> OTodo::toExtraMap()const {
void OTodo::changeOrModify() {
if ( data->count != 1 ) {
-// qWarning("changeOrModify");
+ qWarning("changeOrModify");
data->deref();
OTodoData* d2 = new OTodoData();
@@ -377,4 +394,6 @@ void OTodo::copy( OTodoData* src, OTodoData* dest ) {
dest->hasAlarmDateTime = src->hasAlarmDateTime;
dest->alarmDateTime = src->alarmDateTime;
+ dest->state = src->state;
+ dest->recur = src->recur;
}
QString OTodo::type() const {