summaryrefslogtreecommitdiffabout
path: root/kaddressbook/incsearchwidget.cpp
Unidiff
Diffstat (limited to 'kaddressbook/incsearchwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/incsearchwidget.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index 94c37e7..2ffa357 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -46,54 +46,57 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
46 QLabel *label = new QLabel( i18n( "Search:" ), this ); 46 QLabel *label = new QLabel( i18n( "Search:" ), this );
47 label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight ); 47 label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight );
48 layout->addWidget( label ); 48 layout->addWidget( label );
49#endif //KAB_EMBEDDED 49#endif //KAB_EMBEDDED
50 50
51 mSearchText = new KLineEdit( this ); 51 mSearchText = new KLineEdit( this );
52 layout->addWidget( mSearchText ); 52 layout->addWidget( mSearchText );
53// #ifdef KAB_EMBEDDED 53// #ifdef KAB_EMBEDDED
54// if (KGlobal::getOrientation() == KGlobal::Portrait) 54// if (KGlobal::getOrientation() == KGlobal::Portrait)
55// mSearchText->setMaximumWidth(30); 55// mSearchText->setMaximumWidth(30);
56// #endif //KAB_EMBEDDED 56// #endif //KAB_EMBEDDED
57 57
58 58
59 mFieldCombo = new QComboBox( false, this ); 59 mFieldCombo = new QComboBox( false, this );
60 layout->addWidget( mFieldCombo ); 60 layout->addWidget( mFieldCombo );
61 mFieldCombo->setMaximumHeight( 34 ); 61 mFieldCombo->setMaximumHeight( 34 );
62 QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) ); 62 QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) );
63 63
64// #ifndef KAB_EMBEDDED 64// #ifndef KAB_EMBEDDED
65// resize( QSize(420, 50).expandedTo( sizeHint() ) ); 65// resize( QSize(420, 50).expandedTo( sizeHint() ) );
66// #else //KAB_EMBEDDED 66// #else //KAB_EMBEDDED
67// resize( QSize(30, 10).expandedTo( sizeHint() ) ); 67// resize( QSize(30, 10).expandedTo( sizeHint() ) );
68// #endif //KAB_EMBEDDED 68// #endif //KAB_EMBEDDED
69 69
70#ifdef DESKTOP_VERSION
71 // for performance reasons, we do a search on the pda only after return is pressed
70 connect( mSearchText, SIGNAL( textChanged( const QString& ) ), 72 connect( mSearchText, SIGNAL( textChanged( const QString& ) ),
71 SLOT( announceDoSearch() ) ); 73 SLOT( announceDoSearch() ) );
72 connect( mSearchText, SIGNAL( returnPressed() ),
73 SLOT( announceDoSearch() ) );
74 connect( mFieldCombo, SIGNAL( activated( const QString& ) ), 74 connect( mFieldCombo, SIGNAL( activated( const QString& ) ),
75 SLOT( announceDoSearch() ) ); 75 SLOT( announceDoSearch() ) );
76#endif
77 connect( mSearchText, SIGNAL( returnPressed() ),
78 SLOT( announceDoSearch() ) );
76 connect( mFieldCombo, SIGNAL( activated( const QString& ) ), 79 connect( mFieldCombo, SIGNAL( activated( const QString& ) ),
77 SLOT( announceFieldChanged() ) ); 80 SLOT( announceFieldChanged() ) );
78 81
79 setFocusProxy( mSearchText ); 82 setFocusProxy( mSearchText );
80} 83}
81 84
82IncSearchWidget::~IncSearchWidget() 85IncSearchWidget::~IncSearchWidget()
83{ 86{
84 87
85} 88}
86 89
87void IncSearchWidget::announceDoSearch() 90void IncSearchWidget::announceDoSearch()
88{ 91{
89 emit doSearch( mSearchText->text() ); 92 emit doSearch( mSearchText->text() );
90} 93}
91 94
92void IncSearchWidget::announceFieldChanged() 95void IncSearchWidget::announceFieldChanged()
93{ 96{
94 emit fieldChanged(); 97 emit fieldChanged();
95} 98}
96 99
97void IncSearchWidget::setFields( const KABC::Field::List &list ) 100void IncSearchWidget::setFields( const KABC::Field::List &list )
98{ 101{
99 102