-rw-r--r-- | libopie/pim/otodoaccesssql.cpp | 7 | ||||
-rw-r--r-- | libopie2/opiepim/backend/otodoaccesssql.cpp | 7 |
2 files changed, 10 insertions, 4 deletions
diff --git a/libopie/pim/otodoaccesssql.cpp b/libopie/pim/otodoaccesssql.cpp index 25536e0..8add9f7 100644 --- a/libopie/pim/otodoaccesssql.cpp +++ b/libopie/pim/otodoaccesssql.cpp @@ -324,5 +324,7 @@ QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder, /* Category */ if ( sortFilter & 1 ) { - query += " categories like '%" +QString::number(cat)+"%' AND"; + QString str; + if (cat != 0 ) str = QString::number( cat ); + query += " categories like '%" +str+"%' AND"; } /* Show only overdue */ @@ -331,5 +333,5 @@ QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder, QString due; QString base; - base = QString("DueDate <= '%1-%2-%3' AND WHERE completed = 0").arg( date.year() ).arg( date.month() ).arg( date.day() ); + base = QString("DueDate <= '%1-%2-%3' AND completed = 0").arg( date.year() ).arg( date.month() ).arg( date.day() ); query += " " + base + " AND"; } @@ -444,4 +446,5 @@ QArray<int> OTodoAccessBackendSQL::uids( const OSQLResult& res) const{ OSQLResultItem::ValueList::Iterator it; QArray<int> ints(list.count() ); + qWarning(" count = %d", list.count() ); int i = 0; diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp index 25536e0..8add9f7 100644 --- a/libopie2/opiepim/backend/otodoaccesssql.cpp +++ b/libopie2/opiepim/backend/otodoaccesssql.cpp @@ -324,5 +324,7 @@ QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder, /* Category */ if ( sortFilter & 1 ) { - query += " categories like '%" +QString::number(cat)+"%' AND"; + QString str; + if (cat != 0 ) str = QString::number( cat ); + query += " categories like '%" +str+"%' AND"; } /* Show only overdue */ @@ -331,5 +333,5 @@ QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder, QString due; QString base; - base = QString("DueDate <= '%1-%2-%3' AND WHERE completed = 0").arg( date.year() ).arg( date.month() ).arg( date.day() ); + base = QString("DueDate <= '%1-%2-%3' AND completed = 0").arg( date.year() ).arg( date.month() ).arg( date.day() ); query += " " + base + " AND"; } @@ -444,4 +446,5 @@ QArray<int> OTodoAccessBackendSQL::uids( const OSQLResult& res) const{ OSQLResultItem::ValueList::Iterator it; QArray<int> ints(list.count() ); + qWarning(" count = %d", list.count() ); int i = 0; |