summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/otodoaccesssql.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opiepim/backend/otodoaccesssql.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/backend/otodoaccesssql.cpp48
1 files changed, 26 insertions, 22 deletions
diff --git a/libopie2/opiepim/backend/otodoaccesssql.cpp b/libopie2/opiepim/backend/otodoaccesssql.cpp
index 132b5a6..6f65c48 100644
--- a/libopie2/opiepim/backend/otodoaccesssql.cpp
+++ b/libopie2/opiepim/backend/otodoaccesssql.cpp
@@ -29,10 +29,5 @@
*/
-#include <qdatetime.h>
-#include <qmap.h>
-#include <qstring.h>
-
-#include <qpe/global.h>
-
+/* OPIE */
#include <opie2/osqldriver.h>
#include <opie2/osqlresult.h>
@@ -44,4 +39,13 @@
#include <opie2/opimnotifymanager.h>
#include <opie2/opimrecurrence.h>
+#include <opie2/odebug.h>
+
+#include <qpe/global.h>
+
+/* QT */
+#include <qdatetime.h>
+#include <qmap.h>
+#include <qstring.h>
+
using namespace Opie::DB;
@@ -292,5 +296,5 @@ namespace {
- qDebug("add %s", qu.latin1() );
+ odebug << "add " << qu << "" << oendl;
return qu;
}
@@ -457,5 +461,5 @@ OPimTodo OPimTodoAccessBackendSQL::find( int uid, const QArray<int>& ints,
uint cur, Frontend::CacheDirection dir ) const{
uint CACHE = readAhead();
- qDebug("searching for %d", uid );
+ odebug << "searching for " << uid << "" << oendl;
QArray<int> search( CACHE );
uint size =0;
@@ -467,5 +471,5 @@ OPimTodo OPimTodoAccessBackendSQL::find( int uid, const QArray<int>& ints,
case 0: // FIXME: Not a good style to use magic numbers here (eilers)
for (uint i = cur; i < ints.count() && size < CACHE; i++ ) {
- qDebug("size %d %d", size, ints[i] );
+ odebug << "size " << size << " " << ints[i] << "" << oendl;
search[size] = ints[i];
size++;
@@ -542,5 +546,5 @@ QArray<int> OPimTodoAccessBackendSQL::effectiveToDos( const QDate& s,
QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder,
int sortFilter, int cat ) {
- qDebug("sorted %d, %d", asc, sortOrder );
+ odebug << "sorted " << asc << ", " << sortOrder << "" << oendl;
QString query;
query = "select uid from todolist WHERE ";
@@ -601,9 +605,9 @@ QArray<int> OPimTodoAccessBackendSQL::sorted( bool asc, int sortOrder,
if ( !asc ) {
- qDebug("not ascending!");
+ odebug << "not ascending!" << oendl;
query += " DESC";
}
- qDebug( query );
+ odebug << query << oendl;
OSQLRawQuery raw(query );
return uids( m_driver->query(&raw) );
@@ -630,5 +634,5 @@ OPimTodo OPimTodoAccessBackendSQL::todo( const OSQLResult& res ) const{
OSQLResultItem::ValueList list = res.results();
OSQLResultItem::ValueList::Iterator it = list.begin();
- qDebug("todo1");
+ odebug << "todo1" << oendl;
OPimTodo to = todo( (*it) );
cache( to );
@@ -636,5 +640,5 @@ OPimTodo OPimTodoAccessBackendSQL::todo( const OSQLResult& res ) const{
for ( ; it != list.end(); ++it ) {
- qDebug("caching");
+ odebug << "caching" << oendl;
cache( todo( (*it) ) );
}
@@ -642,5 +646,5 @@ OPimTodo OPimTodoAccessBackendSQL::todo( const OSQLResult& res ) const{
}
OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const {
- qDebug("todo(ResultItem)");
+ odebug << "todo(ResultItem)" << oendl;
// Request information from addressbook table and create the OPimTodo-object.
@@ -650,5 +654,5 @@ OPimTodo OPimTodoAccessBackendSQL::todo( OSQLResultItem& item )const {
QStringList cats = QStringList::split(";", item.data("categories") );
- qDebug("Item is completed: %d", item.data("completed").toInt() );
+ odebug << "Item is completed: " << item.data("completed").toInt() << "" << oendl;
OPimTodo to( (bool)item.data("completed").toInt(), item.data("priority").toInt(),
@@ -751,5 +755,5 @@ QArray<int> OPimTodoAccessBackendSQL::uids( const OSQLResult& res) const{
OSQLResultItem::ValueList::Iterator it;
QArray<int> ints(list.count() );
- qDebug(" count = %d", list.count() );
+ odebug << " count = " << list.count() << "" << oendl;
int i = 0;
@@ -777,5 +781,5 @@ QArray<int> OPimTodoAccessBackendSQL::matchRegexp( const QRegExp &r ) const
qu += ")";
- qDebug( "query: %s", qu.latin1() );
+ odebug << "query: " << qu << "" << oendl;
OSQLRawQuery raw( qu );
@@ -817,5 +821,5 @@ void OPimTodoAccessBackendSQL::removeAllCompleted(){
QArray<int> completed_uids = uids( res );
- qDebug( "Number of completed: %d", completed_uids.size() );
+ odebug << "Number of completed: " << completed_uids.size() << "" << oendl;
if ( completed_uids.size() == 0 )
@@ -843,10 +847,10 @@ void OPimTodoAccessBackendSQL::removeAllCompleted(){
qu += query + " );";
- qDebug( "query: %s", qu.latin1() );
+ odebug << "query: " << qu << "" << oendl;
OSQLRawQuery raw2( qu );
res = m_driver->query( &raw2 );
if ( res.state() == OSQLResult::Failure ) {
- qWarning("OPimTodoAccessBackendSQL::removeAllCompleted():Failure in query: %s", qu.latin1() );
+ owarn << "OPimTodoAccessBackendSQL::removeAllCompleted():Failure in query: " << qu << "" << oendl;
}
}
@@ -861,5 +865,5 @@ QMap<QString, QString> OPimTodoAccessBackendSQL::requestCustom( int uid ) const
if ( res_custom.state() == OSQLResult::Failure ) {
- qWarning("OSQLResult::Failure in find query !!");
+ owarn << "OSQLResult::Failure in find query !!" << oendl;
QMap<QString, QString> empty;
return empty;