1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 14:16:32 +02:00

TWK-490: Work harder at not selecting inactive items

This commit is contained in:
Leo Franchi
2011-10-02 15:54:09 -04:00
parent dfb03eabe6
commit d8270bddfa

View File

@@ -98,7 +98,7 @@ SourceTreeView::SourceTreeView( QWidget* parent )
header()->setStretchLastSection( false ); header()->setStretchLastSection( false );
header()->setResizeMode( 0, QHeaderView::Stretch ); header()->setResizeMode( 0, QHeaderView::Stretch );
connect( this, SIGNAL( clicked( QModelIndex ) ), SLOT( onItemActivated( QModelIndex ) ) ); connect( this, SIGNAL( activated( QModelIndex ) ), SLOT( onItemActivated( QModelIndex ) ) );
connect( this, SIGNAL( expanded( QModelIndex ) ), this, SLOT( onItemExpanded( QModelIndex ) ) ); connect( this, SIGNAL( expanded( QModelIndex ) ), this, SLOT( onItemExpanded( QModelIndex ) ) );
// connect( selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), SLOT( onSelectionChanged() ) ); // connect( selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), SLOT( onSelectionChanged() ) );
@@ -200,7 +200,7 @@ SourceTreeView::showOfflineSources( bool offlineSourcesShown )
void void
SourceTreeView::onItemActivated( const QModelIndex& index ) SourceTreeView::onItemActivated( const QModelIndex& index )
{ {
if ( !index.isValid() ) if ( !index.isValid() || !index.flags().testFlag( Qt::ItemIsEnabled ) )
return; return;
SourceTreeItem* item = itemFromIndex< SourceTreeItem >( index ); SourceTreeItem* item = itemFromIndex< SourceTreeItem >( index );