Diffstat (limited to 'libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp index bb5c99b..401a3c1 100644 --- a/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp +++ b/libopie2/opiepim/backend/ocontactaccessbackend_sql.cpp | |||
@@ -580,62 +580,62 @@ QArray<int> OPimContactAccessBackend_SQL::queryByExample ( const OPimContact &qu | |||
580 | } | 580 | } |
581 | // Skip trailing "AND" | 581 | // Skip trailing "AND" |
582 | // if ( isAnyFieldSelected ) | 582 | // if ( isAnyFieldSelected ) |
583 | // qu = qu.left( qu.length() - 4 ); | 583 | // qu = qu.left( qu.length() - 4 ); |
584 | 584 | ||
585 | qu += searchQuery; | 585 | qu += searchQuery; |
586 | 586 | ||
587 | qDebug( "queryByExample query: %s", qu.latin1() ); | 587 | qDebug( "queryByExample query: %s", qu.latin1() ); |
588 | 588 | ||
589 | // Execute query and return the received uid's | 589 | // Execute query and return the received uid's |
590 | OSQLRawQuery raw( qu ); | 590 | OSQLRawQuery raw( qu ); |
591 | OSQLResult res = m_driver->query( &raw ); | 591 | OSQLResult res = m_driver->query( &raw ); |
592 | if ( res.state() != OSQLResult::Success ){ | 592 | if ( res.state() != OSQLResult::Success ){ |
593 | QArray<int> empty; | 593 | QArray<int> empty; |
594 | return empty; | 594 | return empty; |
595 | } | 595 | } |
596 | 596 | ||
597 | QArray<int> list = extractUids( res ); | 597 | QArray<int> list = extractUids( res ); |
598 | 598 | ||
599 | return list; | 599 | return list; |
600 | } | 600 | } |
601 | 601 | ||
602 | QArray<int> OPimContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const | 602 | QArray<int> OPimContactAccessBackend_SQL::matchRegexp( const QRegExp &r ) const |
603 | { | 603 | { |
604 | #if 1 | 604 | #if 0 |
605 | QArray<int> nix(0); | 605 | QArray<int> nix(0); |
606 | return nix; | 606 | return nix; |
607 | 607 | ||
608 | #else | 608 | #else |
609 | QString qu = "SELECT uid FROM addressbook WHERE ("; | 609 | QString qu = "SELECT uid FROM addressbook WHERE ("; |
610 | QString searchlist; | 610 | QString searchlist; |
611 | 611 | ||
612 | QStringList fieldList = OPimContactFields::untrfields( false ); | 612 | QStringList fieldList = OPimContactFields::untrfields( false ); |
613 | // QMap<QString, int> translate = OPimContactFields::untrFieldsToId(); | 613 | // QMap<QString, int> translate = OPimContactFields::untrFieldsToId(); |
614 | for ( QStringList::Iterator it = ++fieldList.begin(); it != fieldList.end(); ++it ){ | 614 | for ( QStringList::Iterator it = ++fieldList.begin(); it != fieldList.end(); ++it ){ |
615 | if ( !searchlist.isEmpty() ) | 615 | if ( !searchlist.isEmpty() ) |
616 | searchlist += " OR "; | 616 | searchlist += " OR "; |
617 | searchlist += "\"" + *it + "\" rlike(\"" + r.pattern() + "\") "; | 617 | searchlist += " rlike(\""+ r.pattern() + "\",\"" + *it + "\") "; |
618 | } | 618 | } |
619 | 619 | ||
620 | qu = qu + searchlist + ")"; | 620 | qu = qu + searchlist + ")"; |
621 | 621 | ||
622 | qDebug( "query: %s", qu.latin1() ); | 622 | qDebug( "query: %s", qu.latin1() ); |
623 | 623 | ||
624 | OSQLRawQuery raw( qu ); | 624 | OSQLRawQuery raw( qu ); |
625 | OSQLResult res = m_driver->query( &raw ); | 625 | OSQLResult res = m_driver->query( &raw ); |
626 | 626 | ||
627 | return extractUids( res ); | 627 | return extractUids( res ); |
628 | 628 | ||
629 | 629 | ||
630 | #endif | 630 | #endif |
631 | } | 631 | } |
632 | 632 | ||
633 | const uint OPimContactAccessBackend_SQL::querySettings() | 633 | const uint OPimContactAccessBackend_SQL::querySettings() |
634 | { | 634 | { |
635 | return OPimContactAccess::IgnoreCase | 635 | return OPimContactAccess::IgnoreCase |
636 | | OPimContactAccess::WildCards | 636 | | OPimContactAccess::WildCards |
637 | | OPimContactAccess::DateDiff | 637 | | OPimContactAccess::DateDiff |
638 | | OPimContactAccess::DateYear | 638 | | OPimContactAccess::DateYear |
639 | | OPimContactAccess::DateMonth | 639 | | OPimContactAccess::DateMonth |
640 | | OPimContactAccess::DateDay | 640 | | OPimContactAccess::DateDay |
641 | ; | 641 | ; |