Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index f4f3c94..105c106 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp @@ -31,20 +31,25 @@ * */ -#include <stdio.h> -#include <stdlib.h> - -#include <qarray.h> -#include <qstringlist.h> - -#include <qpe/global.h> - +/* OPIE */ #include <opie2/osqldriver.h> #include <opie2/osqlmanager.h> #include <opie2/osqlquery.h> #include <opie2/opimrecurrence.h> #include <opie2/odatebookaccessbackend_sql.h> +#include <opie2/odebug.h> + +#include <qpe/global.h> + +/* QT */ +#include <qarray.h> +#include <qstringlist.h> + +/* STD */ +#include <stdio.h> +#include <stdlib.h> + using namespace Opie::DB; @@ -162,7 +167,7 @@ bool ODateBookAccessBackend_SQL::load() qu += "create table custom_data( uid INTEGER, id INTEGER, type VARCHAR(10), priority INTEGER, value VARCHAR(10), PRIMARY KEY /* identifier */ (uid, id) );"; - qWarning( "command: %s", qu.latin1() ); + owarn << "command: " << qu << "" << oendl; OSQLRawQuery raw( qu ); OSQLResult res = m_driver->query( &raw ); @@ -221,12 +226,12 @@ void ODateBookAccessBackend_SQL::clear() OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{ - qDebug( "ODateBookAccessBackend_SQL::find( %d )", uid ); + odebug << "ODateBookAccessBackend_SQL::find( " << uid << " )" << oendl; QString qu = "select *"; qu += "from datebook where uid = " + QString::number(uid); - qDebug( "Query: %s", qu.latin1() ); + odebug << "Query: " << qu << "" << oendl; OSQLRawQuery raw( qu ); OSQLResult res = m_driver->query( &raw ); @@ -247,7 +252,7 @@ OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{ OPimEvent retDate( dateEventMap ); retDate.setExtraMap( requestCustom( uid ) ); - qDebug( "ODateBookAccessBackend_SQL::find( %d ) end", uid ); + odebug << "ODateBookAccessBackend_SQL::find( " << uid << " ) end" << oendl; return retDate; } @@ -283,7 +288,7 @@ bool ODateBookAccessBackend_SQL::add( const OPimEvent& ev ) + it.data() //.latin1() + "');"; } - qWarning("add %s", qu.latin1() ); + owarn << "add " << qu << "" << oendl; OSQLRawQuery raw( qu ); OSQLResult res = m_driver->query( &raw ); @@ -390,7 +395,7 @@ QArray<int> ODateBookAccessBackend_SQL::matchRegexp( const QRegExp &r ) const qu += " )"; - qDebug( "query: %s", qu.latin1() ); + odebug << "query: " << qu << "" << oendl; OSQLRawQuery raw( qu ); OSQLResult res = m_driver->query( &raw ); @@ -405,20 +410,20 @@ QArray<int> ODateBookAccessBackend_SQL::matchRegexp( const QRegExp &r ) const QArray<int> ODateBookAccessBackend_SQL::extractUids( OSQLResult& res ) const { - qWarning("extractUids"); + owarn << "extractUids" << oendl; QTime t; t.start(); OSQLResultItem::ValueList list = res.results(); OSQLResultItem::ValueList::Iterator it; QArray<int> ints(list.count() ); - qWarning(" count = %d", list.count() ); + owarn << " count = " << list.count() << "" << oendl; int i = 0; for (it = list.begin(); it != list.end(); ++it ) { ints[i] = (*it).data("uid").toInt(); i++; } - qWarning("extractUids ready: count2 = %d needs %d ms", i, t.elapsed() ); + owarn << "extractUids ready: count2 = " << i << " needs " << t.elapsed() << " ms" << oendl; return ints; @@ -435,7 +440,7 @@ QMap<QString, QString> ODateBookAccessBackend_SQL::requestCustom( int uid ) cons OSQLResult res_custom = m_driver->query( &query ); 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; } @@ -446,7 +451,7 @@ QMap<QString, QString> ODateBookAccessBackend_SQL::requestCustom( int uid ) cons customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); } - qDebug("RequestCustom needed: %d ms", t.elapsed() ); + odebug << "RequestCustom needed: " << t.elapsed() << " ms" << oendl; return customMap; } |