Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp index 8a8cb0b..495a8dd 100644 --- a/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp | |||
@@ -221,6 +221,8 @@ void ODateBookAccessBackend_SQL::clear() | |||
221 | 221 | ||
222 | 222 | ||
223 | OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{ | 223 | OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{ |
224 | qDebug( "ODateBookAccessBackend_SQL::find( %d )", uid ); | ||
225 | |||
224 | QString qu = "select *"; | 226 | QString qu = "select *"; |
225 | qu += "from datebook where uid = " + QString::number(uid); | 227 | qu += "from datebook where uid = " + QString::number(uid); |
226 | 228 | ||
@@ -242,6 +244,8 @@ OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{ | |||
242 | // Last step: Put map into date event, add custom map and return it | 244 | // Last step: Put map into date event, add custom map and return it |
243 | OPimEvent retDate( dateEventMap ); | 245 | OPimEvent retDate( dateEventMap ); |
244 | retDate.setExtraMap( requestCustom( uid ) ); | 246 | retDate.setExtraMap( requestCustom( uid ) ); |
247 | |||
248 | qDebug( "ODateBookAccessBackend_SQL::find() end", uid ); | ||
245 | return retDate; | 249 | return retDate; |
246 | } | 250 | } |
247 | 251 | ||
@@ -375,8 +379,24 @@ OPimEvent::ValueList ODateBookAccessBackend_SQL::directRawRepeats() | |||
375 | 379 | ||
376 | QArray<int> ODateBookAccessBackend_SQL::matchRegexp( const QRegExp &r ) const | 380 | QArray<int> ODateBookAccessBackend_SQL::matchRegexp( const QRegExp &r ) const |
377 | { | 381 | { |
378 | QArray<int> null; | 382 | |
379 | return null; | 383 | QString qu = "SELECT uid FROM datebook WHERE ("; |
384 | |||
385 | // Do it make sense to search other fields, too ? | ||
386 | qu += " rlike(\""+ r.pattern() + "\", Location ) OR"; | ||
387 | qu += " rlike(\""+ r.pattern() + "\", Note )"; | ||
388 | |||
389 | qu += " )"; | ||
390 | |||
391 | qDebug( "query: %s", qu.latin1() ); | ||
392 | |||
393 | OSQLRawQuery raw( qu ); | ||
394 | OSQLResult res = m_driver->query( &raw ); | ||
395 | |||
396 | return extractUids( res ); | ||
397 | |||
398 | |||
399 | |||
380 | } | 400 | } |
381 | 401 | ||
382 | /* ===== Private Functions ========================================== */ | 402 | /* ===== Private Functions ========================================== */ |