summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/abtable.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/abtable.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp
index 9297d6a..97f4a8f 100644
--- a/core/pim/addressbook/abtable.cpp
+++ b/core/pim/addressbook/abtable.cpp
@@ -129,5 +129,5 @@ AbTable::AbTable( const QValueList<int> *order, QWidget *parent, const char *nam
asc( TRUE ),
intFields( order ),
- currFindRow( -2 ),
+ currFindRow( -1 ),
mCat( 0 ),
m_contactdb ("addressbook", 0l, 0l, false) // Handle syncing myself.. !
@@ -639,13 +639,17 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive,
{
int category = 0;
+
+ // Use the current Category if nothing else selected
if ( cat.isEmpty() )
- category = -2; // mCat.id("Contacts", "All");
- else
+ category = mCat.id( "Contacts", showCat );
+ else{
category = mCat.id("Contacts", cat );
+ }
qWarning ("Found in Category %d", category);
if ( currFindRow < -1 )
- currFindRow = currentRow() - 1;
+ currFindRow = - 1;
+
clearSelection( TRUE );
int rows, row;
@@ -660,5 +664,4 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive,
ati = static_cast<AbTableItem*>( item(row, 0) );
if ( contactCompare( contactList[ati], r, category ) )
- //if ( contactCompare( contactList[row], r, category ) )
break;
}
@@ -667,5 +670,4 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive,
ati = static_cast<AbTableItem*>( item(row, 0) );
if ( contactCompare( contactList[ati], r, category ) )
- //if ( contactCompare( contactList[row], r, category ) )
break;
}
@@ -689,5 +691,5 @@ void AbTable::slotDoFind( const QString &findString, bool caseSensitive,
foundSelection.expandTo( currFindRow, numCols() - 1 );
addSelection( foundSelection );
- setCurrentCell( currFindRow, numCols() - 1 );
+ setCurrentCell( currFindRow, 0 /* numCols() - 1 */ );
wrapAround = true;
}
@@ -701,5 +703,5 @@ static bool contactCompare( const OContact &cnt, const QRegExp &r, int category
returnMe = false;
- if ( (category == -1 && cats.count() == 0) || category == -2 )
+ if ( (cats.count() == 0) || (category == 0) )
returnMe = cnt.match( r );
else {