summaryrefslogtreecommitdiff
path: root/libopie/pim/otodoaccesssql.cpp
authoreilers <eilers>2003-11-10 08:28:38 (UTC)
committer eilers <eilers>2003-11-10 08:28:38 (UTC)
commitf3326a60ba002b420f33b6132dc1740c0fc4ffef (patch) (side-by-side diff)
tree6809f30857a241cf3334f7d25f60edc6fbb83901 /libopie/pim/otodoaccesssql.cpp
parentefa3f9a756fb5a9afd0d35bc783e1331bf40bc6a (diff)
downloadopie-f3326a60ba002b420f33b6132dc1740c0fc4ffef.zip
opie-f3326a60ba002b420f33b6132dc1740c0fc4ffef.tar.gz
opie-f3326a60ba002b420f33b6132dc1740c0fc4ffef.tar.bz2
Platform MacOS-X: Disable backtrce in odebug..
Libopie PIM: Finishing SQL-Backend for Todo. Recurrance events are supported now. What is still missing: Custom entries currently not stored. It isn't easy to implement them with enabled prefetch-cache. LibopieDB2: Adding -lsqlite here instead linking it to libopie
Diffstat (limited to 'libopie/pim/otodoaccesssql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/pim/otodoaccesssql.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/libopie/pim/otodoaccesssql.cpp b/libopie/pim/otodoaccesssql.cpp
index ebd03bb..3913661 100644
--- a/libopie/pim/otodoaccesssql.cpp
+++ b/libopie/pim/otodoaccesssql.cpp
@@ -125,3 +125,5 @@ namespace {
qu += "description, summary, priority, DueDate, progress , state, ";
- qu += "Recurrence, reminders, alarms, maintainer, startdate, completeddate);";
+ // This is the recurrance-stuff .. Exceptions are currently not supported (see ORecur.cpp) ! (eilers)
+ qu += "RType, RWeekdays, RPosition, RFreq, RHasEndDate, EndDate, Created, Exceptions, ";
+ qu += "reminders, alarms, maintainer, startdate, completeddate);";
qu += "create table custom_data( uid INTEGER, id INTEGER, type VARCHAR(10), value VARCHAR(10), PRIMARY KEY /* identifier */ (uid, id) );";
@@ -176,2 +178,3 @@ namespace {
QString qu;
+ QMap<int, QString> recMap = m_todo.recurrence().toMap();
qu = "insert into todolist VALUES("
@@ -188,3 +191,10 @@ namespace {
+ QString::number( m_todo.state().state() ) + ","
- + "'" + m_todo.recurrence().toString() + "'"+ ",";
+ + "'" + recMap[ ORecur::RType ] + "'" + ","
+ + "'" + recMap[ ORecur::RWeekdays ] + "'" + ","
+ + "'" + recMap[ ORecur::RPosition ] + "'" + ","
+ + "'" + recMap[ ORecur::RFreq ] + "'" + ","
+ + "'" + recMap[ ORecur::RHasEndDate ] + "'" + ","
+ + "'" + recMap[ ORecur::EndDate ] + "'" + ","
+ + "'" + recMap[ ORecur::Created ] + "'" + ","
+ + "'" + recMap[ ORecur::Exceptions ] + "'" + ",";
@@ -526,2 +536,4 @@ OTodo OTodoAccessBackendSQL::todo( OSQLResultItem& item )const {
+ qWarning("Item is completed: %d", item.data("completed").toInt() );
+
OTodo to( (bool)item.data("completed").toInt(), item.data("priority").toInt(),
@@ -554,4 +566,15 @@ OTodo OTodoAccessBackendSQL::todo( OSQLResultItem& item )const {
- // Recurrence not supported yet
- // to.setRecurrence(
+ QMap<int, QString> recMap;
+ recMap.insert( ORecur::RType , item.data("RType") );
+ recMap.insert( ORecur::RWeekdays , item.data("RWeekdays") );
+ recMap.insert( ORecur::RPosition , item.data("RPosition") );
+ recMap.insert( ORecur::RFreq , item.data("RFreq") );
+ recMap.insert( ORecur::RHasEndDate, item.data("RHasEndDate") );
+ recMap.insert( ORecur::EndDate , item.data("EndDate") );
+ recMap.insert( ORecur::Created , item.data("Created") );
+ recMap.insert( ORecur::Exceptions , item.data("Exceptions") );
+
+ ORecur recur;
+ recur.fromMap( recMap );
+ to.setRecurrence( recur );