author | ar <ar> | 2004-06-01 21:38:07 (UTC) |
---|---|---|
committer | ar <ar> | 2004-06-01 21:38:07 (UTC) |
commit | baed1d5ab8589aef14440009bc4e7380bcc5a741 (patch) (side-by-side diff) | |
tree | c636e892c5eec0df2b36d16cb601a7da41a2ef0f /libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |
parent | 4438393d8eef624565e840b798429071829adea8 (diff) | |
download | opie-baed1d5ab8589aef14440009bc4e7380bcc5a741.zip opie-baed1d5ab8589aef14440009bc4e7380bcc5a741.tar.gz opie-baed1d5ab8589aef14440009bc4e7380bcc5a741.tar.bz2 |
- convert to odebug framework
Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | 64 |
1 files changed, 34 insertions, 30 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index 14207be..dda23cc 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp @@ -32,13 +32,7 @@ #include "ocontactaccessbackend_sql.h" -#include <qarray.h> -#include <qdatetime.h> -#include <qstringlist.h> - -#include <qpe/global.h> -#include <qpe/recordfields.h> - +/* OPIE */ #include <opie2/opimcontact.h> #include <opie2/opimcontactfields.h> #include <opie2/opimdateconversion.h> @@ -46,6 +40,16 @@ #include <opie2/osqlresult.h> #include <opie2/osqlmanager.h> #include <opie2/osqlquery.h> +#include <opie2/odebug.h> + +#include <qpe/global.h> +#include <qpe/recordfields.h> + +/* QT */ +#include <qarray.h> +#include <qdatetime.h> +#include <qstringlist.h> + using namespace Opie; using namespace Opie::DB; @@ -268,7 +272,7 @@ namespace { + "');"; } // qu += "commit;"; - qDebug("add %s", qu.latin1() ); + odebug << "add " << qu << "" << oendl; return qu; } @@ -316,7 +320,7 @@ namespace { QString qu = "select *"; qu += " from addressbook where uid = " + QString::number(m_uid); - // qWarning("find query: %s", qu.latin1() ); + // owarn << "find query: " << qu << "" << oendl; return qu; } @@ -350,7 +354,7 @@ OPimContactAccessBackend_SQL::OPimContactAccessBackend_SQL ( const QString& /* a const QString& filename ): OPimContactAccessBackend(), m_changed(false), m_driver( NULL ) { - qDebug("C'tor OPimContactAccessBackend_SQL starts"); + odebug << "C'tor OPimContactAccessBackend_SQL starts" << oendl; QTime t; t.start(); @@ -367,7 +371,7 @@ OPimContactAccessBackend_SQL::OPimContactAccessBackend_SQL ( const QString& /* a load(); - qDebug("C'tor OPimContactAccessBackend_SQL ends: %d ms", t.elapsed() ); + odebug << "C'tor OPimContactAccessBackend_SQL ends: " << t.elapsed() << " ms" << oendl; } OPimContactAccessBackend_SQL::~OPimContactAccessBackend_SQL () @@ -430,7 +434,7 @@ QArray<int> OPimContactAccessBackend_SQL::allRecords() const bool OPimContactAccessBackend_SQL::add ( const OPimContact &newcontact ) { - qDebug("add in contact SQL-Backend"); + odebug << "add in contact SQL-Backend" << oendl; InsertQuery ins( newcontact ); OSQLResult res = m_driver->query( &ins ); @@ -469,14 +473,14 @@ bool OPimContactAccessBackend_SQL::replace ( const OPimContact &contact ) OPimContact OPimContactAccessBackend_SQL::find ( int uid ) const { - qDebug("OPimContactAccessBackend_SQL::find()"); + odebug << "OPimContactAccessBackend_SQL::find()" << oendl; QTime t; t.start(); OPimContact retContact( requestNonCustom( uid ) ); retContact.setExtraMap( requestCustom( uid ) ); - qDebug("OPimContactAccessBackend_SQL::find() needed: %d ms", t.elapsed() ); + odebug << "OPimContactAccessBackend_SQL::find() needed: " << t.elapsed() << " ms" << oendl; return retContact; } @@ -585,7 +589,7 @@ QArray<int> OPimContactAccessBackend_SQL::queryByExample ( const OPimContact &qu qu += searchQuery; - qDebug( "queryByExample query: %s", qu.latin1() ); + odebug << "queryByExample query: " << qu << "" << oendl; // Execute query and return the received uid's OSQLRawQuery raw( qu ); @@ -620,7 +624,7 @@ QArray<int> OPimContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const qu = qu + searchlist + ")"; - qDebug( "query: %s", qu.latin1() ); + odebug << "query: " << qu << "" << oendl; OSQLRawQuery raw( qu ); OSQLResult res = m_driver->query( &raw ); @@ -701,7 +705,7 @@ QArray<int> OPimContactAccessBackend_SQL::sorted( bool asc, int , int , int ) if ( !asc ) query += "DESC"; - // qDebug("sorted query is: %s", query.latin1() ); + // odebug << "sorted query is: " << query << "" << oendl; OSQLRawQuery raw( query ); OSQLResult res = m_driver->query( &raw ); @@ -712,14 +716,14 @@ QArray<int> OPimContactAccessBackend_SQL::sorted( bool asc, int , int , int ) QArray<int> list = extractUids( res ); - qDebug("sorted needed %d ms!", t.elapsed() ); + odebug << "sorted needed " << t.elapsed() << " ms!" << oendl; return list; } void OPimContactAccessBackend_SQL::update() { - qDebug("Update starts"); + odebug << "Update starts" << oendl; QTime t; t.start(); @@ -735,25 +739,25 @@ void OPimContactAccessBackend_SQL::update() m_changed = false; - qDebug("Update ends %d ms", t.elapsed() ); + odebug << "Update ends " << t.elapsed() << " ms" << oendl; } QArray<int> OPimContactAccessBackend_SQL::extractUids( OSQLResult& res ) const { - qDebug("extractUids"); + odebug << "extractUids" << oendl; QTime t; t.start(); OSQLResultItem::ValueList list = res.results(); OSQLResultItem::ValueList::Iterator it; QArray<int> ints(list.count() ); - qDebug(" count = %d", list.count() ); + odebug << " count = " << list.count() << "" << oendl; int i = 0; for (it = list.begin(); it != list.end(); ++it ) { ints[i] = (*it).data("uid").toInt(); i++; } - qDebug("extractUids ready: count2 = %d needs %d ms", i, t.elapsed() ); + odebug << "extractUids ready: count2 = " << i << " needs " << t.elapsed() << " ms" << oendl; return ints; @@ -788,7 +792,7 @@ QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) co int id = translate[*it]; QString value = resItem.data( (*it) ); - // qDebug("Reading %s... found: %s", (*it).latin1(), value.latin1() ); + // odebug << "Reading " << (*it) << "... found: " << value << "" << oendl; switch( id ){ case Qtopia::Birthday: @@ -806,7 +810,7 @@ QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) co } break; case Qtopia::AddressCategory: - qDebug("Category is: %s", value.latin1() ); + odebug << "Category is: " << value << "" << oendl; default: nonCustomMap.insert( id, value ); } @@ -816,9 +820,9 @@ QMap<int, QString> OPimContactAccessBackend_SQL::requestNonCustom( int uid ) co nonCustomMap.insert( Qtopia::AddressUid, resItem.data( "uid" ) ); t3needed = t3.elapsed(); - // qDebug("Adding UID: %s", resItem.data( "uid" ).latin1() ); - qDebug("RequestNonCustom needed: insg.:%d ms, query: %d ms, mapping: %d ms", - t.elapsed(), t2needed, t3needed ); + // odebug << "Adding UID: " << resItem.data( "uid" ) << "" << oendl; + odebug << "RequestNonCustom needed: insg.:" << t.elapsed() << " ms, query: " << t2needed + << " ms, mapping: " << t3needed << " ms" << oendl; return nonCustomMap; } @@ -834,7 +838,7 @@ QMap<QString, QString> OPimContactAccessBackend_SQL::requestCustom( int uid ) c 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; } @@ -845,7 +849,7 @@ QMap<QString, QString> OPimContactAccessBackend_SQL::requestCustom( int uid ) c customMap.insert( (*it).data( "type" ), (*it).data( "value" ) ); } - qDebug("RequestCustom needed: %d ms", t.elapsed() ); + odebug << "RequestCustom needed: " << t.elapsed() << " ms" << oendl; return customMap; } |