-rw-r--r-- | kaddressbook/incsearchwidget.cpp | 19 | ||||
-rw-r--r-- | kaddressbook/incsearchwidget.h | 1 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabprefs.h | 1 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.h | 2 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 2 |
8 files changed, 28 insertions, 7 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp index 2ffa357..3533427 100644 --- a/kaddressbook/incsearchwidget.cpp +++ b/kaddressbook/incsearchwidget.cpp @@ -32,2 +32,4 @@ #include <kglobal.h> +#include <kglobal.h> +#include "kabprefs.h" @@ -69,9 +71,9 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) -#ifdef DESKTOP_VERSION + // for performance reasons, we do a search on the pda only after return is pressed connect( mSearchText, SIGNAL( textChanged( const QString& ) ), - SLOT( announceDoSearch() ) ); + SLOT( announceDoSearch2() ) ); connect( mFieldCombo, SIGNAL( activated( const QString& ) ), - SLOT( announceDoSearch() ) ); -#endif + SLOT( announceDoSearch2() ) ); + connect( mSearchText, SIGNAL( returnPressed() ), @@ -88,2 +90,9 @@ IncSearchWidget::~IncSearchWidget() } +void IncSearchWidget::announceDoSearch2() +{ + if ( KABPrefs::instance()->mSearchWithReturn ) + return; + emit doSearch( mSearchText->text() ); + //qDebug("emit dosreach "); +} @@ -91,3 +100,5 @@ void IncSearchWidget::announceDoSearch() { + emit doSearch( mSearchText->text() ); + // qDebug("emit dosreach "); } diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h index 09fb8ac..5c95438 100644 --- a/kaddressbook/incsearchwidget.h +++ b/kaddressbook/incsearchwidget.h @@ -64,2 +64,3 @@ class IncSearchWidget : public QWidget void announceDoSearch(); + void announceDoSearch2(); void announceFieldChanged(); diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index bbf8e1b..f0a49f8 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -1387,3 +1387,3 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), - // SLOT( slotEditorDestroyed( const QString& ) ) ); + // SLOT( slotEditorDestroyed( const QString& ) ) ; } diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index 2425158..552c933 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp @@ -52,2 +52,4 @@ KABPrefs::KABPrefs() addItemBool("ToolBarUp",&mToolBarUp, false ); + addItemBool("SearchWithReturn",&mSearchWithReturn, true ); + diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index 03e529f..e4f359c 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h @@ -68,2 +68,3 @@ class KABPrefs : public KPimPrefs bool mMultipleViewsAtOnce; + bool mSearchWithReturn; QValueList<int> mExtensionsSplitter; diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 3a2ccbb..0c3a199 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp @@ -108,2 +108,4 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) boxLayout->setSpacing( KDialog::spacingHintSmall() ); + mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); + boxLayout->addWidget( mSearchReturnBox ); mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); @@ -154,2 +156,3 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); + connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); @@ -182,2 +185,3 @@ void KABConfigWidget::restoreSettings(KABPrefs* prefs) mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); + mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); @@ -198,2 +202,3 @@ void KABConfigWidget::saveSettings(KABPrefs* prefs) prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); + prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); @@ -214,2 +219,3 @@ void KABConfigWidget::defaults(KABPrefs* prefs) mMultipleViewsAtOnce->setChecked( true ); + mSearchReturnBox->setChecked( true ); mAskForQuit->setChecked (true); diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h index 831efc1..6cd4223 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.h +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h @@ -67,3 +67,3 @@ class KABConfigWidget : public QWidget KListView *mExtensionView; - + QCheckBox *mSearchReturnBox; QCheckBox *mNameParsing; diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 12f7c27..63ad0ed 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp @@ -152,3 +152,3 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); - continue; + break; } |