summaryrefslogtreecommitdiffabout
path: root/kaddressbook/incsearchwidget.cpp
Unidiff
Diffstat (limited to 'kaddressbook/incsearchwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/incsearchwidget.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index 2ffa357..3533427 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -27,12 +27,14 @@
27#include <qcombobox.h> 27#include <qcombobox.h>
28 28
29#include <kdialog.h> 29#include <kdialog.h>
30#include <klineedit.h> 30#include <klineedit.h>
31#include <klocale.h> 31#include <klocale.h>
32#include <kglobal.h> 32#include <kglobal.h>
33#include <kglobal.h>
34#include "kabprefs.h"
33 35
34#include "incsearchwidget.h" 36#include "incsearchwidget.h"
35 37
36IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) 38IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
37 : QWidget( parent, name ) 39 : QWidget( parent, name )
38{ 40{
@@ -64,35 +66,44 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
64// #ifndef KAB_EMBEDDED 66// #ifndef KAB_EMBEDDED
65// resize( QSize(420, 50).expandedTo( sizeHint() ) ); 67// resize( QSize(420, 50).expandedTo( sizeHint() ) );
66// #else //KAB_EMBEDDED 68// #else //KAB_EMBEDDED
67// resize( QSize(30, 10).expandedTo( sizeHint() ) ); 69// resize( QSize(30, 10).expandedTo( sizeHint() ) );
68// #endif //KAB_EMBEDDED 70// #endif //KAB_EMBEDDED
69 71
70#ifdef DESKTOP_VERSION 72
71 // for performance reasons, we do a search on the pda only after return is pressed 73 // for performance reasons, we do a search on the pda only after return is pressed
72 connect( mSearchText, SIGNAL( textChanged( const QString& ) ), 74 connect( mSearchText, SIGNAL( textChanged( const QString& ) ),
73 SLOT( announceDoSearch() ) ); 75 SLOT( announceDoSearch2() ) );
74 connect( mFieldCombo, SIGNAL( activated( const QString& ) ), 76 connect( mFieldCombo, SIGNAL( activated( const QString& ) ),
75 SLOT( announceDoSearch() ) ); 77 SLOT( announceDoSearch2() ) );
76#endif 78
77 connect( mSearchText, SIGNAL( returnPressed() ), 79 connect( mSearchText, SIGNAL( returnPressed() ),
78 SLOT( announceDoSearch() ) ); 80 SLOT( announceDoSearch() ) );
79 connect( mFieldCombo, SIGNAL( activated( const QString& ) ), 81 connect( mFieldCombo, SIGNAL( activated( const QString& ) ),
80 SLOT( announceFieldChanged() ) ); 82 SLOT( announceFieldChanged() ) );
81 83
82 setFocusProxy( mSearchText ); 84 setFocusProxy( mSearchText );
83} 85}
84 86
85IncSearchWidget::~IncSearchWidget() 87IncSearchWidget::~IncSearchWidget()
86{ 88{
87 89
88} 90}
91void IncSearchWidget::announceDoSearch2()
92{
93 if ( KABPrefs::instance()->mSearchWithReturn )
94 return;
95 emit doSearch( mSearchText->text() );
96 //qDebug("emit dosreach ");
97}
89 98
90void IncSearchWidget::announceDoSearch() 99void IncSearchWidget::announceDoSearch()
91{ 100{
101
92 emit doSearch( mSearchText->text() ); 102 emit doSearch( mSearchText->text() );
103 // qDebug("emit dosreach ");
93} 104}
94 105
95void IncSearchWidget::announceFieldChanged() 106void IncSearchWidget::announceFieldChanged()
96{ 107{
97 emit fieldChanged(); 108 emit fieldChanged();
98} 109}