Diffstat (limited to 'libopie2/opiepim/backend/otodoaccesssql.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/otodoaccesssql.cpp | 48 |
1 files changed, 32 insertions, 16 deletions
diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index d255c66..ebd03bb 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/otodoaccesssql.cpp | |||
@@ -11,2 +11,5 @@ | |||
11 | #include "otodoaccesssql.h" | 11 | #include "otodoaccesssql.h" |
12 | #include "opimstate.h" | ||
13 | #include "opimnotifymanager.h" | ||
14 | #include "orecur.h" | ||
12 | 15 | ||
@@ -122,3 +125,4 @@ namespace { | |||
122 | qu += "description, summary, priority, DueDate, progress , state, "; | 125 | qu += "description, summary, priority, DueDate, progress , state, "; |
123 | qu += "Recurrence, notifiers, maintainer, startdate, completeddate)"; | 126 | qu += "Recurrence, reminders, alarms, maintainer, startdate, completeddate);"; |
127 | qu += "create table custom_data( uid INTEGER, id INTEGER, type VARCHAR(10), value VARCHAR(10), PRIMARY KEY /* identifier */ (uid, id) );"; | ||
124 | return qu; | 128 | return qu; |
@@ -183,7 +187,16 @@ namespace { | |||
183 | + QString::number( m_todo.progress() ) + "," | 187 | + QString::number( m_todo.progress() ) + "," |
184 | + "''" + "," // state (conversion needed) | 188 | + QString::number( m_todo.state().state() ) + "," |
185 | // + QString::number( m_todo.state() ) + "," | 189 | + "'" + m_todo.recurrence().toString() + "'"+ ","; |
186 | + "''" + "," // Recurrence (conversion needed) | 190 | |
187 | + "''" + "," // Notifiers (conversion needed) | 191 | if ( m_todo.hasNotifiers() ) { |
188 | + "''" + "," // Maintainers (conversion needed) | 192 | OPimNotifyManager manager = m_todo.notifiers(); |
193 | qu += "'" + manager.remindersToString() + "'" + "," | ||
194 | + "'" + manager.alarmsToString() + "'" + ","; | ||
195 | } | ||
196 | else{ | ||
197 | qu += QString( "''" ) + "," | ||
198 | + "''" + ","; | ||
199 | } | ||
200 | |||
201 | qu += QString( "''" ) + QString( "," ) // Maintainers (cur. not supported !) | ||
189 | + "'" + QString::number(sYear) + "-" | 202 | + "'" + QString::number(sYear) + "-" |
@@ -533,2 +546,13 @@ OTodo OTodoAccessBackendSQL::todo( OSQLResultItem& item )const { | |||
533 | 546 | ||
547 | OPimNotifyManager& manager = to.notifiers(); | ||
548 | manager.alarmsFromString( item.data("alarms") ); | ||
549 | manager.remindersFromString( item.data("reminders") ); | ||
550 | |||
551 | OPimState pimState; | ||
552 | pimState.setState( QString( item.data("state") ).toInt() ); | ||
553 | to.setState( pimState ); | ||
554 | |||
555 | // Recurrence not supported yet | ||
556 | // to.setRecurrence( | ||
557 | |||
534 | return to; | 558 | return to; |
@@ -623,14 +647,6 @@ QBitArray OTodoAccessBackendSQL::supports()const { | |||
623 | 647 | ||
624 | QBitArray ar( OTodo::CompletedDate + 1 ); | 648 | return sup(); |
625 | ar.fill( true ); | ||
626 | ar[OTodo::CrossReference] = false; | ||
627 | ar[OTodo::State ] = false; | ||
628 | ar[OTodo::Reminders] = false; | ||
629 | ar[OTodo::Notifiers] = false; | ||
630 | ar[OTodo::Maintainer] = false; | ||
631 | |||
632 | return ar; | ||
633 | } | 649 | } |
634 | 650 | ||
635 | QBitArray OTodoAccessBackendSQL::sup() { | 651 | QBitArray OTodoAccessBackendSQL::sup() const{ |
636 | 652 | ||