From 1e7f8f22fc10e3ed85b6563332ddc348c95792d0 Mon Sep 17 00:00:00 2001 From: zecke Date: Thu, 18 Nov 2004 21:49:23 +0000 Subject: Backend Changes: Each Backend can: -Sort and Filter a set of Records/AllRecords (which can be filtered again) -QueryByExample by every Backend -Occurrences for a period of time and a QDateTime -More common implementation -OPimBackendOccurrence with common splitting to OPimOccurrence --- (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp') diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index 105c106..41b714e 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp @@ -167,8 +167,6 @@ 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) );"; - owarn << "command: " << qu << "" << oendl; - OSQLRawQuery raw( qu ); OSQLResult res = m_driver->query( &raw ); if ( res.state() != OSQLResult::Success ) @@ -288,7 +286,6 @@ bool ODateBookAccessBackend_SQL::add( const OPimEvent& ev ) + it.data() //.latin1() + "');"; } - owarn << "add " << qu << "" << oendl; OSQLRawQuery raw( qu ); OSQLResult res = m_driver->query( &raw ); @@ -328,10 +325,6 @@ bool ODateBookAccessBackend_SQL::replace( const OPimEvent& ev ) return add( ev ); } -QArray ODateBookAccessBackend_SQL::rawEvents()const -{ - return allRecords(); -} QArray ODateBookAccessBackend_SQL::rawRepeats()const { @@ -359,7 +352,7 @@ QArray ODateBookAccessBackend_SQL::nonRepeats()const return extractUids( res ); } -OPimEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats() +OPimEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats()const { QArray nonRepUids = nonRepeats(); OPimEvent::ValueList list; @@ -371,7 +364,7 @@ OPimEvent::ValueList ODateBookAccessBackend_SQL::directNonRepeats() return list; } -OPimEvent::ValueList ODateBookAccessBackend_SQL::directRawRepeats() +OPimEvent::ValueList ODateBookAccessBackend_SQL::directRawRepeats()const { QArray rawRepUids = rawRepeats(); OPimEvent::ValueList list; @@ -410,20 +403,17 @@ QArray ODateBookAccessBackend_SQL::matchRegexp( const QRegExp &r ) const QArray ODateBookAccessBackend_SQL::extractUids( OSQLResult& res ) const { - owarn << "extractUids" << oendl; QTime t; t.start(); OSQLResultItem::ValueList list = res.results(); OSQLResultItem::ValueList::Iterator it; QArray ints(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++; } - owarn << "extractUids ready: count2 = " << i << " needs " << t.elapsed() << " ms" << oendl; return ints; @@ -440,7 +430,6 @@ QMap ODateBookAccessBackend_SQL::requestCustom( int uid ) cons OSQLResult res_custom = m_driver->query( &query ); if ( res_custom.state() == OSQLResult::Failure ) { - owarn << "OSQLResult::Failure in find query !!" << oendl; QMap empty; return empty; } -- cgit v0.9.0.2