Diffstat (limited to 'kaddressbook/views/kaddressbookcardview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/views/kaddressbookcardview.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kaddressbook/views/kaddressbookcardview.cpp b/kaddressbook/views/kaddressbookcardview.cpp index 7f33bb4..15f154e 100644 --- a/kaddressbook/views/kaddressbookcardview.cpp +++ b/kaddressbook/views/kaddressbookcardview.cpp | |||
@@ -221,58 +221,63 @@ void KAddressBookCardView::readConfig(KConfig *config) | |||
221 | mCardView->setFont( config->readFontEntry( "TextFont", &f) ); | 221 | mCardView->setFont( config->readFontEntry( "TextFont", &f) ); |
222 | f.setBold( true ); | 222 | f.setBold( true ); |
223 | mCardView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); | 223 | mCardView->setHeaderFont( config->readFontEntry( "HeaderFont", &f ) ); |
224 | } | 224 | } |
225 | else | 225 | else |
226 | { | 226 | { |
227 | mCardView->setFont( f ); | 227 | mCardView->setFont( f ); |
228 | f.setBold( true ); | 228 | f.setBold( true ); |
229 | mCardView->setHeaderFont( f ); | 229 | mCardView->setHeaderFont( f ); |
230 | } | 230 | } |
231 | 231 | ||
232 | mCardView->setDrawCardBorder(config->readBoolEntry("DrawBorder", true)); | 232 | mCardView->setDrawCardBorder(config->readBoolEntry("DrawBorder", true)); |
233 | mCardView->setDrawColSeparators(config->readBoolEntry("DrawSeparators", | 233 | mCardView->setDrawColSeparators(config->readBoolEntry("DrawSeparators", |
234 | true)); | 234 | true)); |
235 | mCardView->setDrawFieldLabels(config->readBoolEntry("DrawFieldLabels",false)); | 235 | mCardView->setDrawFieldLabels(config->readBoolEntry("DrawFieldLabels",false)); |
236 | mShowEmptyFields = config->readBoolEntry("ShowEmptyFields", false); | 236 | mShowEmptyFields = config->readBoolEntry("ShowEmptyFields", false); |
237 | 237 | ||
238 | mCardView->setShowEmptyFields( mShowEmptyFields ); | 238 | mCardView->setShowEmptyFields( mShowEmptyFields ); |
239 | 239 | ||
240 | mCardView->setItemWidth( config->readNumEntry( "ItemWidth", 200 ) ); | 240 | mCardView->setItemWidth( config->readNumEntry( "ItemWidth", 200 ) ); |
241 | mCardView->setItemMargin( config->readNumEntry( "ItemMargin", 0 ) ); | 241 | mCardView->setItemMargin( config->readNumEntry( "ItemMargin", 0 ) ); |
242 | mCardView->setItemSpacing( config->readNumEntry( "ItemSpacing", 10 ) ); | 242 | mCardView->setItemSpacing( config->readNumEntry( "ItemSpacing", 10 ) ); |
243 | mCardView->setSeparatorWidth( config->readNumEntry( "SeparatorWidth", 2 ) ); | 243 | mCardView->setSeparatorWidth( config->readNumEntry( "SeparatorWidth", 2 ) ); |
244 | 244 | ||
245 | #if 0 | ||
246 | // LR KABPrefs::instance()->mHonorSingleClick is handled and fixed in cardviews contentsMouseDoubleClickEven | ||
245 | disconnect(mCardView, SIGNAL(executed(CardViewItem *)), | 247 | disconnect(mCardView, SIGNAL(executed(CardViewItem *)), |
246 | this, SLOT(addresseeExecuted(CardViewItem *))); | 248 | this, SLOT(addresseeExecuted(CardViewItem *))); |
247 | 249 | ||
248 | if (KABPrefs::instance()->mHonorSingleClick) | 250 | if (KABPrefs::instance()->mHonorSingleClick) |
249 | connect(mCardView, SIGNAL(executed(CardViewItem *)), | 251 | connect(mCardView, SIGNAL(executed(CardViewItem *)), |
250 | this, SLOT(addresseeExecuted(CardViewItem *))); | 252 | this, SLOT(addresseeExecuted(CardViewItem *))); |
251 | else | 253 | else |
252 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), | 254 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), |
253 | this, SLOT(addresseeExecuted(CardViewItem *))); | 255 | this, SLOT(addresseeExecuted(CardViewItem *))); |
256 | #endif | ||
254 | 257 | ||
258 | connect(mCardView, SIGNAL(doubleClicked(CardViewItem *)), | ||
259 | this, SLOT(addresseeExecuted(CardViewItem *))); | ||
255 | } | 260 | } |
256 | 261 | ||
257 | void KAddressBookCardView::writeConfig( KConfig *config ) | 262 | void KAddressBookCardView::writeConfig( KConfig *config ) |
258 | { | 263 | { |
259 | config->writeEntry( "ItemWidth", mCardView->itemWidth() ); | 264 | config->writeEntry( "ItemWidth", mCardView->itemWidth() ); |
260 | KAddressBookView::writeConfig( config ); | 265 | KAddressBookView::writeConfig( config ); |
261 | } | 266 | } |
262 | void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) | 267 | void KAddressBookCardView::doSearch( const QString& s,KABC::Field *field ) |
263 | { | 268 | { |
264 | mCardView->clear(); | 269 | mCardView->clear(); |
265 | if ( s.isEmpty() || s == "*" ) { | 270 | if ( s.isEmpty() || s == "*" ) { |
266 | refresh(); | 271 | refresh(); |
267 | return; | 272 | return; |
268 | } | 273 | } |
269 | QString pattern = s.lower()+"*"; | 274 | QString pattern = s.lower()+"*"; |
270 | QRegExp re; | 275 | QRegExp re; |
271 | re.setWildcard(true); // most people understand these better. | 276 | re.setWildcard(true); // most people understand these better. |
272 | re.setCaseSensitive(false); | 277 | re.setCaseSensitive(false); |
273 | re.setPattern( pattern ); | 278 | re.setPattern( pattern ); |
274 | if (!re.isValid()) | 279 | if (!re.isValid()) |
275 | return; | 280 | return; |
276 | mCardView->viewport()->setUpdatesEnabled( false ); | 281 | mCardView->viewport()->setUpdatesEnabled( false ); |
277 | KABC::Addressee::List addresseeList = addressees(); | 282 | KABC::Addressee::List addresseeList = addressees(); |
278 | KABC::Addressee::List::Iterator it; | 283 | KABC::Addressee::List::Iterator it; |