Diffstat (limited to 'kaddressbook/incsearchwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/incsearchwidget.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp index b1ffe04..5f8b83d 100644 --- a/kaddressbook/incsearchwidget.cpp +++ b/kaddressbook/incsearchwidget.cpp | |||
@@ -97,51 +97,54 @@ IncSearchWidget::~IncSearchWidget() | |||
97 | 97 | ||
98 | } | 98 | } |
99 | void IncSearchWidget::announceDoSearch2() | 99 | void IncSearchWidget::announceDoSearch2() |
100 | { | 100 | { |
101 | if ( KABPrefs::instance()->mSearchWithReturn ) | 101 | if ( KABPrefs::instance()->mSearchWithReturn ) |
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 | ||
107 | void IncSearchWidget::announceDoSearch() | 107 | void 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 | ||
114 | void IncSearchWidget::announceFieldChanged() | 114 | void IncSearchWidget::announceFieldChanged() |
115 | { | 115 | { |
116 | emit fieldChanged(); | 116 | emit fieldChanged(); |
117 | } | 117 | } |
118 | void IncSearchWidget::setSize() | 118 | void 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 | setCurrentItem( 0 ); |
122 | mSearchText->setMaximumWidth( 30 ); | 122 | //mFieldCombo->setMaximumWidth( 0 ); |
123 | mFieldCombo->hide(); | ||
124 | mSearchText->setMaximumWidth( 200 ); | ||
123 | } else { | 125 | } else { |
126 | mFieldCombo->show(); | ||
124 | QFontMetrics fm ( mFieldCombo->font() ); | 127 | QFontMetrics fm ( mFieldCombo->font() ); |
125 | int wid = fm.width(i18n( "All Fields" ) ); | 128 | int wid = fm.width(i18n( "All Fields" ) ); |
126 | #ifdef DESKTOP_VERSION | 129 | #ifdef DESKTOP_VERSION |
127 | mFieldCombo->setMinimumWidth( wid+60 ); | 130 | mFieldCombo->setMinimumWidth( wid+60 ); |
128 | wid = wid * 2; | 131 | wid = wid * 2; |
129 | #endif | 132 | #endif |
130 | mFieldCombo->setMaximumWidth( wid+60 ); | 133 | mFieldCombo->setMaximumWidth( wid+60 ); |
131 | mSearchText->setMaximumWidth( 1024 ); | 134 | mSearchText->setMaximumWidth( 1024 ); |
132 | } | 135 | } |
133 | } | 136 | } |
134 | void IncSearchWidget::setFields( const KABC::Field::List &list ) | 137 | void IncSearchWidget::setFields( const KABC::Field::List &list ) |
135 | { | 138 | { |
136 | 139 | ||
137 | mFieldCombo->clear(); | 140 | mFieldCombo->clear(); |
138 | mFieldCombo->insertItem( i18n( "All Fields" ) ); | 141 | mFieldCombo->insertItem( i18n( "All Fields" ) ); |
139 | 142 | ||
140 | KABC::Field::List::ConstIterator it; | 143 | KABC::Field::List::ConstIterator it; |
141 | for ( it = list.begin(); it != list.end(); ++it ) { | 144 | for ( it = list.begin(); it != list.end(); ++it ) { |
142 | mFieldCombo->insertItem( (*it)->label() ); | 145 | mFieldCombo->insertItem( (*it)->label() ); |
143 | } | 146 | } |
144 | 147 | ||
145 | mFieldList = list; | 148 | mFieldList = list; |
146 | 149 | ||
147 | announceDoSearch(); | 150 | announceDoSearch(); |