mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 19:30:21 +02:00
TWK-490: Work harder at not selecting inactive items
This commit is contained in:
@@ -98,7 +98,7 @@ SourceTreeView::SourceTreeView( QWidget* parent )
|
||||
header()->setStretchLastSection( false );
|
||||
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( selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), SLOT( onSelectionChanged() ) );
|
||||
|
||||
@@ -200,7 +200,7 @@ SourceTreeView::showOfflineSources( bool offlineSourcesShown )
|
||||
void
|
||||
SourceTreeView::onItemActivated( const QModelIndex& index )
|
||||
{
|
||||
if ( !index.isValid() )
|
||||
if ( !index.isValid() || !index.flags().testFlag( Qt::ItemIsEnabled ) )
|
||||
return;
|
||||
|
||||
SourceTreeItem* item = itemFromIndex< SourceTreeItem >( index );
|
||||
|
Reference in New Issue
Block a user