summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/incsearchwidget.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index 314de10..7577079 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -102,49 +102,51 @@ void IncSearchWidget::announceDoSearch2()
102 return; 102 return;
103 emit doSearch( mSearchText->text() ); 103 emit doSearch( mSearchText->text() );
104 //qDebug("emit dosreach "); 104 //qDebug("emit dosreach ");
105} 105}
106 106
107void IncSearchWidget::announceDoSearch() 107void IncSearchWidget::announceDoSearch()
108{ 108{
109 109
110 emit doSearch( mSearchText->text() ); 110 emit doSearch( mSearchText->text() );
111 // qDebug("emit dosreach "); 111 // qDebug("emit dosreach ");
112} 112}
113 113
114void IncSearchWidget::announceFieldChanged() 114void IncSearchWidget::announceFieldChanged()
115{ 115{
116 emit fieldChanged(); 116 emit fieldChanged();
117} 117}
118void IncSearchWidget::setSize() 118void IncSearchWidget::setSize()
119{ 119{
120 if ( KABPrefs::instance()->mHideSearchOnSwitch && QApplication::desktop()->width() == 480) { 120 if ( KABPrefs::instance()->mHideSearchOnSwitch && QApplication::desktop()->width() == 480) {
121 mFieldCombo->setMaximumWidth( 40 ); 121 mFieldCombo->setMaximumWidth( 40 );
122 mSearchText->setMaximumWidth( 30 ); 122 mSearchText->setMaximumWidth( 30 );
123 } else { 123 } else {
124 QFontMetrics fm ( mFieldCombo->font() ); 124 QFontMetrics fm ( mFieldCombo->font() );
125 int wid = fm.width(i18n( "All Fields" ) ); 125 int wid = fm.width(i18n( "All Fields" ) );
126 int max = wid; 126#ifdef DESKTOP_VERSION
127 wid = wid * 2;
128#endif
127 mFieldCombo->setMaximumWidth( wid+60 ); 129 mFieldCombo->setMaximumWidth( wid+60 );
128 mSearchText->setMaximumWidth( 1024 ); 130 mSearchText->setMaximumWidth( 1024 );
129 } 131 }
130} 132}
131void IncSearchWidget::setFields( const KABC::Field::List &list ) 133void IncSearchWidget::setFields( const KABC::Field::List &list )
132{ 134{
133 135
134 mFieldCombo->clear(); 136 mFieldCombo->clear();
135 mFieldCombo->insertItem( i18n( "All Fields" ) ); 137 mFieldCombo->insertItem( i18n( "All Fields" ) );
136 138
137 KABC::Field::List::ConstIterator it; 139 KABC::Field::List::ConstIterator it;
138 for ( it = list.begin(); it != list.end(); ++it ) { 140 for ( it = list.begin(); it != list.end(); ++it ) {
139 mFieldCombo->insertItem( (*it)->label() ); 141 mFieldCombo->insertItem( (*it)->label() );
140 } 142 }
141 143
142 mFieldList = list; 144 mFieldList = list;
143 145
144 announceDoSearch(); 146 announceDoSearch();
145 announceFieldChanged(); 147 announceFieldChanged();
146 setSize(); 148 setSize();
147} 149}
148 150
149KABC::Field::List IncSearchWidget::fields() const 151KABC::Field::List IncSearchWidget::fields() const
150{ 152{