author | eilers <eilers> | 2002-10-19 17:54:00 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-19 17:54:00 (UTC) |
commit | 8c9e2e893540c0a405637f10ac2f656df69991a7 (patch) (side-by-side diff) | |
tree | ec9841bdd08c95ef1dc4e1a239d7736e760c2a46 /core/pim/addressbook/abtable.cpp | |
parent | ccdf857edfb52f788c5b00440cce24d1bced2a18 (diff) | |
download | opie-8c9e2e893540c0a405637f10ac2f656df69991a7.zip opie-8c9e2e893540c0a405637f10ac2f656df69991a7.tar.gz opie-8c9e2e893540c0a405637f10ac2f656df69991a7.tar.bz2 |
New find widget works. Settings moved into a config dialog.
Diffstat (limited to 'core/pim/addressbook/abtable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 18 |
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 { |