summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccesssql.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp
index ef036d5..132b5a6 100644
--- a/libopie2/opiepim/backend/otodoaccesssql.cpp
+++ b/libopie2/opiepim/backend/otodoaccesssql.cpp
@@ -167,5 +167,5 @@ namespace {
167 int m_uid; 167 int m_uid;
168 }; 168 };
169 169
170 170
171 171
@@ -177,5 +177,5 @@ namespace {
177 qu += "description, summary, priority, DueDate, progress , state, "; 177 qu += "description, summary, priority, DueDate, progress , state, ";
178 // This is the recurrance-stuff .. Exceptions are currently not supported (see OPimRecurrence.cpp) ! (eilers) 178 // This is the recurrance-stuff .. Exceptions are currently not supported (see OPimRecurrence.cpp) ! (eilers)
179 qu += "RType, RWeekdays, RPosition, RFreq, RHasEndDate, EndDate, Created, Exceptions, "; 179 qu += "RType, RWeekdays, RPosition, RFreq, RHasEndDate, EndDate, Created, Exceptions, ";
180 qu += "reminders, alarms, maintainer, startdate, completeddate);"; 180 qu += "reminders, alarms, maintainer, startdate, completeddate);";
181 qu += "create table custom_data( uid INTEGER, id INTEGER, type VARCHAR(10), priority INTEGER, value VARCHAR(10), PRIMARY KEY /* identifier */ (uid, id) );"; 181 qu += "create table custom_data( uid INTEGER, id INTEGER, type VARCHAR(10), priority INTEGER, value VARCHAR(10), PRIMARY KEY /* identifier */ (uid, id) );";
@@ -221,5 +221,5 @@ namespace {
221 sMonth= sDate.month(); 221 sMonth= sDate.month();
222 sDay = sDate.day(); 222 sDay = sDate.day();
223 } 223 }
224 224
225 int eYear = 0, eMonth = 0, eDay = 0; 225 int eYear = 0, eMonth = 0, eDay = 0;
@@ -229,15 +229,15 @@ namespace {
229 eMonth= eDate.month(); 229 eMonth= eDate.month();
230 eDay = eDate.day(); 230 eDay = eDate.day();
231 } 231 }
232 QString qu; 232 QString qu;
233 QMap<int, QString> recMap = m_todo.recurrence().toMap(); 233 QMap<int, QString> recMap = m_todo.recurrence().toMap();
234 qu = "insert into todolist VALUES(" 234 qu = "insert into todolist VALUES("
235 + QString::number( m_todo.uid() ) + "," 235 + QString::number( m_todo.uid() ) + ","
236 + "'" + m_todo.idsToString( m_todo.categories() ) + "'" + "," 236 + "'" + m_todo.idsToString( m_todo.categories() ) + "'" + ","
237 + QString::number( m_todo.isCompleted() ) + "," 237 + QString::number( m_todo.isCompleted() ) + ","
238 + "'" + m_todo.description() + "'" + "," 238 + "'" + m_todo.description() + "'" + ","
239 + "'" + m_todo.summary() + "'" + "," 239 + "'" + m_todo.summary() + "'" + ","
240 + QString::number(m_todo.priority() ) + "," 240 + QString::number(m_todo.priority() ) + ","
241 + "'" + QString::number(year).rightJustify( 4, '0' ) + "-" 241 + "'" + QString::number(year).rightJustify( 4, '0' ) + "-"
242 + QString::number(month).rightJustify( 2, '0' ) 242 + QString::number(month).rightJustify( 2, '0' )
243 + "-" + QString::number( day ).rightJustify( 2, '0' )+ "'" + "," 243 + "-" + QString::number( day ).rightJustify( 2, '0' )+ "'" + ","
@@ -252,8 +252,8 @@ namespace {
252 + "'" + recMap[ OPimRecurrence::Created ] + "'" + "," 252 + "'" + recMap[ OPimRecurrence::Created ] + "'" + ","
253 + "'" + recMap[ OPimRecurrence::Exceptions ] + "'" + ","; 253 + "'" + recMap[ OPimRecurrence::Exceptions ] + "'" + ",";
254 254
255 if ( m_todo.hasNotifiers() ) { 255 if ( m_todo.hasNotifiers() ) {
256 OPimNotifyManager manager = m_todo.notifiers(); 256 OPimNotifyManager manager = m_todo.notifiers();
257 qu += "'" + manager.remindersToString() + "'" + "," 257 qu += "'" + manager.remindersToString() + "'" + ","
258 + "'" + manager.alarmsToString() + "'" + ","; 258 + "'" + manager.alarmsToString() + "'" + ",";
259 } 259 }
@@ -264,5 +264,5 @@ namespace {
264 264
265 qu += QString( "''" ) + QString( "," ) // Maintainers (cur. not supported !) 265 qu += QString( "''" ) + QString( "," ) // Maintainers (cur. not supported !)
266 + "'" + QString::number(sYear).rightJustify( 4, '0' ) + "-" 266 + "'" + QString::number(sYear).rightJustify( 4, '0' ) + "-"
267 + QString::number(sMonth).rightJustify( 2, '0' ) 267 + QString::number(sMonth).rightJustify( 2, '0' )
268 + "-" + QString::number(sDay).rightJustify( 2, '0' )+ "'" + "," 268 + "-" + QString::number(sDay).rightJustify( 2, '0' )+ "'" + ","
@@ -270,5 +270,5 @@ namespace {
270 + QString::number(eMonth).rightJustify( 2, '0' ) 270 + QString::number(eMonth).rightJustify( 2, '0' )
271 + "-"+QString::number(eDay).rightJustify( 2, '0' ) + "'" 271 + "-"+QString::number(eDay).rightJustify( 2, '0' ) + "'"
272 + ")"; 272 + "); ";
273 273
274 // Save custom Entries: 274 // Save custom Entries:
@@ -276,19 +276,19 @@ namespace {
276 id = 0; 276 id = 0;
277 QMap<QString, QString> customMap = m_todo.toExtraMap(); 277 QMap<QString, QString> customMap = m_todo.toExtraMap();
278 for( QMap<QString, QString>::Iterator it = customMap.begin(); 278 for( QMap<QString, QString>::Iterator it = customMap.begin();
279 it != customMap.end(); ++it ){ 279 it != customMap.end(); ++it ){
280 qu += "insert into custom_data VALUES(" 280 qu += "insert into custom_data VALUES("
281 + QString::number( m_todo.uid() ) 281 + QString::number( m_todo.uid() )
282 + "," 282 + ","
283 + QString::number( id++ ) 283 + QString::number( id++ )
284 + ",'" 284 + ",'"
285 + it.key() 285 + it.key()
286 + "'," 286 + "',"
287 + "0" // Priority for future enhancements 287 + "0" // Priority for future enhancements
288 + ",'" 288 + ",'"
289 + it.data() 289 + it.data()
290 + "');"; 290 + "');";
291 } 291 }
292 292
293 293
294 qDebug("add %s", qu.latin1() ); 294 qDebug("add %s", qu.latin1() );
@@ -645,5 +645,5 @@ OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const {
645 645
646 // Request information from addressbook table and create the OPimTodo-object. 646 // Request information from addressbook table and create the OPimTodo-object.
647 647
648 bool hasDueDate = false; QDate dueDate = QDate::currentDate(); 648 bool hasDueDate = false; QDate dueDate = QDate::currentDate();
649 hasDueDate = date( dueDate, item.data("DueDate") ); 649 hasDueDate = date( dueDate, item.data("DueDate") );
@@ -671,5 +671,5 @@ OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const {
671 if ( hasCompletedDate ) 671 if ( hasCompletedDate )
672 to.setCompletedDate( completedDate ); 672 to.setCompletedDate( completedDate );
673 673
674 OPimNotifyManager& manager = to.notifiers(); 674 OPimNotifyManager& manager = to.notifiers();
675 manager.alarmsFromString( item.data("alarms") ); 675 manager.alarmsFromString( item.data("alarms") );
@@ -689,5 +689,5 @@ OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const {
689 recMap.insert( OPimRecurrence::Created , item.data("Created") ); 689 recMap.insert( OPimRecurrence::Created , item.data("Created") );
690 recMap.insert( OPimRecurrence::Exceptions , item.data("Exceptions") ); 690 recMap.insert( OPimRecurrence::Exceptions , item.data("Exceptions") );
691 691
692 OPimRecurrence recur; 692 OPimRecurrence recur;
693 recur.fromMap( recMap ); 693 recur.fromMap( recMap );
@@ -774,5 +774,5 @@ QArray<int> OPimTodoAccessBackendSQL::matchRegexp( const QRegExp &r ) const
774 qu += " rlike(\""+ r.pattern() + "\",\"description\") OR"; 774 qu += " rlike(\""+ r.pattern() + "\",\"description\") OR";
775 qu += " rlike(\""+ r.pattern() + "\",\"summary\")"; 775 qu += " rlike(\""+ r.pattern() + "\",\"summary\")";
776 776
777 qu += ")"; 777 qu += ")";
778 778
@@ -802,10 +802,10 @@ QBitArray OPimTodoAccessBackendSQL::sup() const{
802 ar[OPimTodo::Notifiers] = false; 802 ar[OPimTodo::Notifiers] = false;
803 ar[OPimTodo::Maintainer] = false; 803 ar[OPimTodo::Maintainer] = false;
804 804
805 return ar; 805 return ar;
806} 806}
807 807
808void OPimTodoAccessBackendSQL::removeAllCompleted(){ 808void OPimTodoAccessBackendSQL::removeAllCompleted(){
809 // First we need the uids from all entries which are 809 // First we need the uids from all entries which are
810 // completed. Then, we just have to remove them... 810 // completed. Then, we just have to remove them...
811 811
@@ -856,5 +856,5 @@ QMap<QString, QString> OPimTodoAccessBackendSQL::requestCustom( int uid ) const
856{ 856{
857 QMap<QString, QString> customMap; 857 QMap<QString, QString> customMap;
858 858
859 FindCustomQuery query( uid ); 859 FindCustomQuery query( uid );
860 OSQLResult res_custom = m_driver->query( &query ); 860 OSQLResult res_custom = m_driver->query( &query );