summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend
authorzecke <zecke>2002-10-20 12:15:51 (UTC)
committer zecke <zecke>2002-10-20 12:15:51 (UTC)
commit82689364fd558ccd28253961204e6b3eb9e32b03 (patch) (side-by-side diff)
treeaec5a649346194aa76aaadd9c7418b700ac4d3d3 /libopie2/opiepim/backend
parent7948b5910a098d05f4cc7d0fb14b0f216bf41358 (diff)
downloadopie-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
Diffstat (limited to 'libopie2/opiepim/backend') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccesssql.cpp2
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
@@ -376,97 +376,97 @@ QArray<int> OTodoAccessBackendSQL::sorted( bool asc, int sortOrder,
int sortFilter, int cat ) {
qWarning("sorted %d, %d", asc, sortOrder );
QString query;
query = "select uid from todolist WHERE ";
/*
* Sort Filter stuff
* not that straight forward
*
*/
/* Category */
if ( sortFilter & 1 ) {
QString str;
if (cat != 0 ) str = QString::number( cat );
query += " categories like '%" +str+"%' AND";
}
/* Show only overdue */
if ( sortFilter & 2 ) {
QDate date = QDate::currentDate();
QString due;
QString base;
base = QString("DueDate <= '%1-%2-%3' AND completed = 0").arg( date.year() ).arg( date.month() ).arg( date.day() );
query += " " + base + " AND";
}
/* not show completed */
if ( sortFilter & 4 ) {
query += " completed = 0 AND";
}else{
query += " ( completed = 1 OR completed = 0) AND";
}
/* srtip the end */
query = query.remove( query.length()-3, 3 );
/*
* sort order stuff
* quite straight forward
*/
query += "ORDER BY ";
switch( sortOrder ) {
/* completed */
case 0:
query += "completed";
break;
case 1:
query += "priority";
break;
case 2:
- query += "description";
+ query += "summary";
break;
case 3:
query += "DueDate";
break;
}
if ( !asc ) {
qWarning("not ascending!");
query += " DESC";
}
qWarning( query );
OSQLRawQuery raw(query );
return uids( m_driver->query(&raw) );
}
bool OTodoAccessBackendSQL::date( QDate& da, const QString& str ) const{
if ( str == "0-0-0" )
return false;
else{
int day, year, month;
QStringList list = QStringList::split("-", str );
year = list[0].toInt();
month = list[1].toInt();
day = list[2].toInt();
da.setYMD( year, month, day );
return true;
}
}
OTodo OTodoAccessBackendSQL::todo( const OSQLResult& res) const{
if ( res.state() == OSQLResult::Failure ) {
OTodo to;
return to;
}
OSQLResultItem::ValueList list = res.results();
OSQLResultItem::ValueList::Iterator it = list.begin();
qWarning("todo1");
OTodo to = todo( (*it) );
cache( to );
++it;
for ( ; it != list.end(); ++it ) {
qWarning("caching");
cache( todo( (*it) ) );
}
return to;
}
OTodo OTodoAccessBackendSQL::todo( OSQLResultItem& item )const {