summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp
authoreilers <eilers>2004-04-12 17:46:08 (UTC)
committer eilers <eilers>2004-04-12 17:46:08 (UTC)
commit78a8f4f240bb57fe4942a30085e6a84fb3c4bac6 (patch) (side-by-side diff)
tree23345a150cbc71ad8ad805fd1c8fa5522e10593f /libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp
parente8592cb2da1719d9ab1dc9e1144810af6af39e84 (diff)
downloadopie-78a8f4f240bb57fe4942a30085e6a84fb3c4bac6.zip
opie-78a8f4f240bb57fe4942a30085e6a84fb3c4bac6.tar.gz
opie-78a8f4f240bb57fe4942a30085e6a84fb3c4bac6.tar.bz2
Implementing regexp search. OSearch works now..
todo: Implemented removal of finished todo items..
Diffstat (limited to 'libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/backend/odatebookaccessbackend_sql.cpp24
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()
OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{
+ qDebug( "ODateBookAccessBackend_SQL::find( %d )", uid );
+
QString qu = "select *";
qu += "from datebook where uid = " + QString::number(uid);
@@ -242,6 +244,8 @@ OPimEvent ODateBookAccessBackend_SQL::find( int uid ) const{
// Last step: Put map into date event, add custom map and return it
OPimEvent retDate( dateEventMap );
retDate.setExtraMap( requestCustom( uid ) );
+
+ qDebug( "ODateBookAccessBackend_SQL::find() end", uid );
return retDate;
}
@@ -375,8 +379,24 @@ OPimEvent::ValueList ODateBookAccessBackend_SQL::directRawRepeats()
QArray<int> ODateBookAccessBackend_SQL::matchRegexp( const QRegExp &r ) const
{
- QArray<int> null;
- return null;
+
+ QString qu = "SELECT uid FROM datebook WHERE (";
+
+ // Do it make sense to search other fields, too ?
+ qu += " rlike(\""+ r.pattern() + "\", Location ) OR";
+ qu += " rlike(\""+ r.pattern() + "\", Note )";
+
+ qu += " )";
+
+ qDebug( "query: %s", qu.latin1() );
+
+ OSQLRawQuery raw( qu );
+ OSQLResult res = m_driver->query( &raw );
+
+ return extractUids( res );
+
+
+
}
/* ===== Private Functions ========================================== */