-rw-r--r-- | microkde/kdeui/klistview.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp index 25327aa..f7d2187 100644 --- a/microkde/kdeui/klistview.cpp +++ b/microkde/kdeui/klistview.cpp | |||
@@ -431,97 +431,106 @@ KListView::KListView( QWidget *parent, const char *name ,bool emulateRightMouse | |||
431 | if (kapp) | 431 | if (kapp) |
432 | { | 432 | { |
433 | connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); | 433 | connect( kapp, SIGNAL( settingsChanged(int) ), SLOT( slotSettingsChanged(int) ) ); |
434 | kapp->addKipcEventMask( KIPC::SettingsChanged ); | 434 | kapp->addKipcEventMask( KIPC::SettingsChanged ); |
435 | } | 435 | } |
436 | */ | 436 | */ |
437 | slotSettingsChanged(1); //US do this to initialize the connections | 437 | slotSettingsChanged(1); //US do this to initialize the connections |
438 | 438 | ||
439 | 439 | ||
440 | connect(&d->autoSelect, SIGNAL( timeout() ), | 440 | connect(&d->autoSelect, SIGNAL( timeout() ), |
441 | this, SLOT( slotAutoSelect() ) ); | 441 | this, SLOT( slotAutoSelect() ) ); |
442 | connect(&d->dragExpand, SIGNAL( timeout() ), | 442 | connect(&d->dragExpand, SIGNAL( timeout() ), |
443 | this, SLOT( slotDragExpand() ) ); | 443 | this, SLOT( slotDragExpand() ) ); |
444 | 444 | ||
445 | // context menu handling | 445 | // context menu handling |
446 | if (d->showContextMenusOnPress) | 446 | if (d->showContextMenusOnPress) |
447 | { | 447 | { |
448 | connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), | 448 | connect (this, SIGNAL (rightButtonPressed (QListViewItem*, const QPoint&, int)), |
449 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); | 449 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); |
450 | } | 450 | } |
451 | else | 451 | else |
452 | { | 452 | { |
453 | connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), | 453 | connect (this, SIGNAL (rightButtonClicked (QListViewItem*, const QPoint&, int)), |
454 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); | 454 | this, SLOT (emitContextMenu (QListViewItem*, const QPoint&, int))); |
455 | } | 455 | } |
456 | 456 | ||
457 | connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)), | 457 | connect (this, SIGNAL (menuShortCutPressed (KListView*, QListViewItem*)), |
458 | this, SLOT (emitContextMenu (KListView*, QListViewItem*))); | 458 | this, SLOT (emitContextMenu (KListView*, QListViewItem*))); |
459 | 459 | ||
460 | 460 | ||
461 | //qDebug("KListView::KListView make alternate color configurable"); | 461 | //qDebug("KListView::KListView make alternate color configurable"); |
462 | d->alternateBackground = KGlobalSettings::alternateBackgroundColor(); | 462 | d->alternateBackground = KGlobalSettings::alternateBackgroundColor(); |
463 | } | 463 | } |
464 | 464 | ||
465 | 465 | ||
466 | 466 | ||
467 | KListView::~KListView() | 467 | KListView::~KListView() |
468 | { | 468 | { |
469 | delete d; | 469 | delete d; |
470 | } | 470 | } |
471 | 471 | ||
472 | bool KListView::isExecuteArea( const QPoint& point ) | 472 | bool KListView::isExecuteArea( const QPoint& point ) |
473 | { | 473 | { |
474 | if ( itemAt( point ) ) | 474 | if ( itemAt( point ) ) |
475 | return isExecuteArea( point.x() ); | 475 | return isExecuteArea( point.x() ); |
476 | 476 | ||
477 | return false; | 477 | return false; |
478 | } | 478 | } |
479 | QSize KListView::sizeHint() const | ||
480 | { | ||
481 | //qDebug("KListView::QSize sizeHint() "); | ||
482 | #ifdef DESKTOP_VERSION | ||
483 | QListView::sizeHint(); | ||
484 | #else | ||
485 | return QSize ( 40, 40 ); | ||
486 | #endif | ||
479 | 487 | ||
488 | } | ||
480 | bool KListView::isExecuteArea( int x ) | 489 | bool KListView::isExecuteArea( int x ) |
481 | { | 490 | { |
482 | if( allColumnsShowFocus() ) | 491 | if( allColumnsShowFocus() ) |
483 | return true; | 492 | return true; |
484 | else { | 493 | else { |
485 | int offset = 0; | 494 | int offset = 0; |
486 | int width = columnWidth( 0 ); | 495 | int width = columnWidth( 0 ); |
487 | int pos = header()->mapToIndex( 0 ); | 496 | int pos = header()->mapToIndex( 0 ); |
488 | 497 | ||
489 | for ( int index = 0; index < pos; index++ ) | 498 | for ( int index = 0; index < pos; index++ ) |
490 | offset += columnWidth( header()->mapToSection( index ) ); | 499 | offset += columnWidth( header()->mapToSection( index ) ); |
491 | 500 | ||
492 | x += contentsX(); // in case of a horizontal scrollbar | 501 | x += contentsX(); // in case of a horizontal scrollbar |
493 | return ( x > offset && x < ( offset + width ) ); | 502 | return ( x > offset && x < ( offset + width ) ); |
494 | } | 503 | } |
495 | } | 504 | } |
496 | 505 | ||
497 | void KListView::slotOnItem( QListViewItem *item ) | 506 | void KListView::slotOnItem( QListViewItem *item ) |
498 | { | 507 | { |
499 | QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); | 508 | QPoint vp = viewport()->mapFromGlobal( QCursor::pos() ); |
500 | if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) { | 509 | if ( item && isExecuteArea( vp.x() ) && (d->autoSelectDelay > -1) && d->bUseSingle ) { |
501 | d->autoSelect.start( d->autoSelectDelay, true ); | 510 | d->autoSelect.start( d->autoSelectDelay, true ); |
502 | d->pCurrentItem = item; | 511 | d->pCurrentItem = item; |
503 | } | 512 | } |
504 | } | 513 | } |
505 | 514 | ||
506 | void KListView::slotOnViewport() | 515 | void KListView::slotOnViewport() |
507 | { | 516 | { |
508 | if ( d->bChangeCursorOverItem ) | 517 | if ( d->bChangeCursorOverItem ) |
509 | viewport()->unsetCursor(); | 518 | viewport()->unsetCursor(); |
510 | 519 | ||
511 | d->autoSelect.stop(); | 520 | d->autoSelect.stop(); |
512 | d->pCurrentItem = 0L; | 521 | d->pCurrentItem = 0L; |
513 | } | 522 | } |
514 | 523 | ||
515 | void KListView::slotSettingsChanged(int category) | 524 | void KListView::slotSettingsChanged(int category) |
516 | { | 525 | { |
517 | //qDebug("KListView::slotSettingsChanged has to be verified"); | 526 | //qDebug("KListView::slotSettingsChanged has to be verified"); |
518 | 527 | ||
519 | 528 | ||
520 | switch (category) | 529 | switch (category) |
521 | { | 530 | { |
522 | //US I create my private category (=1) to set the settings | 531 | //US I create my private category (=1) to set the settings |
523 | case 1: | 532 | case 1: |
524 | d->dragDelay = 2; | 533 | d->dragDelay = 2; |
525 | //US set explicitly d->bUseSingle = KGlobalSettings::singleClick(); | 534 | //US set explicitly d->bUseSingle = KGlobalSettings::singleClick(); |
526 | // qDebug("KListView::slotSettingsChanged: single%i", d->bUseSingle); | 535 | // qDebug("KListView::slotSettingsChanged: single%i", d->bUseSingle); |
527 | 536 | ||