Diffstat (limited to 'kaddressbook/incsearchwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/incsearchwidget.cpp | 19 |
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 | |||
@@ -25,16 +25,18 @@ | |||
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qtooltip.h> | 26 | #include <qtooltip.h> |
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 | ||
36 | IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) | 38 | IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) |
37 | : QWidget( parent, name ) | 39 | : QWidget( parent, name ) |
38 | { | 40 | { |
39 | #ifndef KAB_EMBEDDED | 41 | #ifndef KAB_EMBEDDED |
40 | //US setCaption( i18n( "Incremental Search" ) ); | 42 | //US setCaption( i18n( "Incremental Search" ) ); |
@@ -62,39 +64,48 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) | |||
62 | QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) ); | 64 | QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) ); |
63 | 65 | ||
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 | ||
85 | IncSearchWidget::~IncSearchWidget() | 87 | IncSearchWidget::~IncSearchWidget() |
86 | { | 88 | { |
87 | 89 | ||
88 | } | 90 | } |
91 | void IncSearchWidget::announceDoSearch2() | ||
92 | { | ||
93 | if ( KABPrefs::instance()->mSearchWithReturn ) | ||
94 | return; | ||
95 | emit doSearch( mSearchText->text() ); | ||
96 | //qDebug("emit dosreach "); | ||
97 | } | ||
89 | 98 | ||
90 | void IncSearchWidget::announceDoSearch() | 99 | void IncSearchWidget::announceDoSearch() |
91 | { | 100 | { |
101 | |||
92 | emit doSearch( mSearchText->text() ); | 102 | emit doSearch( mSearchText->text() ); |
103 | // qDebug("emit dosreach "); | ||
93 | } | 104 | } |
94 | 105 | ||
95 | void IncSearchWidget::announceFieldChanged() | 106 | void IncSearchWidget::announceFieldChanged() |
96 | { | 107 | { |
97 | emit fieldChanged(); | 108 | emit fieldChanged(); |
98 | } | 109 | } |
99 | 110 | ||
100 | void IncSearchWidget::setFields( const KABC::Field::List &list ) | 111 | void IncSearchWidget::setFields( const KABC::Field::List &list ) |