author | zecke <zecke> | 2002-10-20 12:15:51 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-20 12:15:51 (UTC) |
commit | 82689364fd558ccd28253961204e6b3eb9e32b03 (patch) (unidiff) | |
tree | aec5a649346194aa76aaadd9c7418b700ac4d3d3 /libopie2/opiepim/backend | |
parent | 7948b5910a098d05f4cc7d0fb14b0f216bf41358 (diff) | |
download | opie-82689364fd558ccd28253961204e6b3eb9e32b03.zip opie-82689364fd558ccd28253961204e6b3eb9e32b03.tar.gz opie-82689364fd558ccd28253961204e6b3eb9e32b03.tar.bz2 |
Added ORecur which is a base class for Recurrance extracted from TT Event class
and a widget where you can set the Recurrance
This will be used at least in Todolist and Datebook and in the common
classes of OTodo and OEvent
Fixed the SQL in multiple ways it's summary not description for example
-rw-r--r-- | libopie2/opiepim/backend/otodoaccesssql.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index 8c2ea3a..761d7d8 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/otodoaccesssql.cpp | |||
@@ -400,49 +400,49 @@ QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder, | |||
400 | /* not show completed */ | 400 | /* not show completed */ |
401 | if ( sortFilter & 4 ) { | 401 | if ( sortFilter & 4 ) { |
402 | query += " completed = 0 AND"; | 402 | query += " completed = 0 AND"; |
403 | }else{ | 403 | }else{ |
404 | query += " ( completed = 1 OR completed = 0) AND"; | 404 | query += " ( completed = 1 OR completed = 0) AND"; |
405 | } | 405 | } |
406 | /* srtip the end */ | 406 | /* srtip the end */ |
407 | query = query.remove( query.length()-3, 3 ); | 407 | query = query.remove( query.length()-3, 3 ); |
408 | 408 | ||
409 | 409 | ||
410 | /* | 410 | /* |
411 | * sort order stuff | 411 | * sort order stuff |
412 | * quite straight forward | 412 | * quite straight forward |
413 | */ | 413 | */ |
414 | query += "ORDER BY "; | 414 | query += "ORDER BY "; |
415 | switch( sortOrder ) { | 415 | switch( sortOrder ) { |
416 | /* completed */ | 416 | /* completed */ |
417 | case 0: | 417 | case 0: |
418 | query += "completed"; | 418 | query += "completed"; |
419 | break; | 419 | break; |
420 | case 1: | 420 | case 1: |
421 | query += "priority"; | 421 | query += "priority"; |
422 | break; | 422 | break; |
423 | case 2: | 423 | case 2: |
424 | query += "description"; | 424 | query += "summary"; |
425 | break; | 425 | break; |
426 | case 3: | 426 | case 3: |
427 | query += "DueDate"; | 427 | query += "DueDate"; |
428 | break; | 428 | break; |
429 | } | 429 | } |
430 | 430 | ||
431 | if ( !asc ) { | 431 | if ( !asc ) { |
432 | qWarning("not ascending!"); | 432 | qWarning("not ascending!"); |
433 | query += " DESC"; | 433 | query += " DESC"; |
434 | } | 434 | } |
435 | 435 | ||
436 | qWarning( query ); | 436 | qWarning( query ); |
437 | OSQLRawQuery raw(query ); | 437 | OSQLRawQuery raw(query ); |
438 | return uids( m_driver->query(&raw) ); | 438 | return uids( m_driver->query(&raw) ); |
439 | } | 439 | } |
440 | bool OTodoAccessBackendSQL::date( QDate& da, const QString& str ) const{ | 440 | bool OTodoAccessBackendSQL::date( QDate& da, const QString& str ) const{ |
441 | if ( str == "0-0-0" ) | 441 | if ( str == "0-0-0" ) |
442 | return false; | 442 | return false; |
443 | else{ | 443 | else{ |
444 | int day, year, month; | 444 | int day, year, month; |
445 | QStringList list = QStringList::split("-", str ); | 445 | QStringList list = QStringList::split("-", str ); |
446 | year = list[0].toInt(); | 446 | year = list[0].toInt(); |
447 | month = list[1].toInt(); | 447 | month = list[1].toInt(); |
448 | day = list[2].toInt(); | 448 | day = list[2].toInt(); |