summaryrefslogtreecommitdiffabout
path: root/kaddressbook/incsearchwidget.cpp
authorzautrix <zautrix>2005-04-22 18:54:01 (UTC)
committer zautrix <zautrix>2005-04-22 18:54:01 (UTC)
commit3fa082fb01716c63546df5d753c1b677e54c59ce (patch) (unidiff)
treef19e79e515174aab2cea0e8016eb9aa59bcc5095 /kaddressbook/incsearchwidget.cpp
parente6feb1ca0c45397ba7b922198c87fe9b95b7d872 (diff)
downloadkdepimpi-3fa082fb01716c63546df5d753c1b677e54c59ce.zip
kdepimpi-3fa082fb01716c63546df5d753c1b677e54c59ce.tar.gz
kdepimpi-3fa082fb01716c63546df5d753c1b677e54c59ce.tar.bz2
fixxx
Diffstat (limited to 'kaddressbook/incsearchwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/incsearchwidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index 7577079..b1ffe04 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -103,48 +103,49 @@ void IncSearchWidget::announceDoSearch2()
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#ifdef DESKTOP_VERSION 126#ifdef DESKTOP_VERSION
127 mFieldCombo->setMinimumWidth( wid+60 );
127 wid = wid * 2; 128 wid = wid * 2;
128#endif 129#endif
129 mFieldCombo->setMaximumWidth( wid+60 ); 130 mFieldCombo->setMaximumWidth( wid+60 );
130 mSearchText->setMaximumWidth( 1024 ); 131 mSearchText->setMaximumWidth( 1024 );
131 } 132 }
132} 133}
133void IncSearchWidget::setFields( const KABC::Field::List &list ) 134void IncSearchWidget::setFields( const KABC::Field::List &list )
134{ 135{
135 136
136 mFieldCombo->clear(); 137 mFieldCombo->clear();
137 mFieldCombo->insertItem( i18n( "All Fields" ) ); 138 mFieldCombo->insertItem( i18n( "All Fields" ) );
138 139
139 KABC::Field::List::ConstIterator it; 140 KABC::Field::List::ConstIterator it;
140 for ( it = list.begin(); it != list.end(); ++it ) { 141 for ( it = list.begin(); it != list.end(); ++it ) {
141 mFieldCombo->insertItem( (*it)->label() ); 142 mFieldCombo->insertItem( (*it)->label() );
142 } 143 }
143 144
144 mFieldList = list; 145 mFieldList = list;
145 146
146 announceDoSearch(); 147 announceDoSearch();
147 announceFieldChanged(); 148 announceFieldChanged();
148 setSize(); 149 setSize();
149} 150}
150 151