1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

* Fixed default flat collection view sorting.

This commit is contained in:
Christian Muehlhaeuser
2011-07-11 03:24:33 +02:00
parent a6944c49ae
commit 2d66feb5b2
3 changed files with 7 additions and 8 deletions

View File

@@ -33,9 +33,6 @@ CollectionView::CollectionView( QWidget* parent )
{ {
setProxyModel( new CollectionProxyModel( this ) ); setProxyModel( new CollectionProxyModel( this ) );
setSortingEnabled( true );
sortByColumn( 0, Qt::AscendingOrder );
setDragDropMode( QAbstractItemView::DragOnly ); setDragDropMode( QAbstractItemView::DragOnly );
setAcceptDrops( false ); setAcceptDrops( false );
} }
@@ -65,9 +62,7 @@ CollectionView::setTrackModel( TrackModel* model )
setColumnHidden( TrackModel::Origin, true ); // Hide origin column per default setColumnHidden( TrackModel::Origin, true ); // Hide origin column per default
setGuid( QString( "collectionview/%1" ).arg( model->columnCount() ) ); setGuid( QString( "collectionview/%1" ).arg( model->columnCount() ) );
sortByColumn( TrackModel::Artist, Qt::AscendingOrder );
setSortingEnabled( true );
sortByColumn( 0, Qt::AscendingOrder );
connect( model, SIGNAL( trackCountChanged( unsigned int ) ), SLOT( onTrackCountChanged( unsigned int ) ) ); connect( model, SIGNAL( trackCountChanged( unsigned int ) ), SLOT( onTrackCountChanged( unsigned int ) ) );
} }

View File

@@ -81,8 +81,9 @@ TrackHeader::checkState()
if ( !state.isEmpty() ) if ( !state.isEmpty() )
{ {
restoreState( state ); restoreState( state );
setSortIndicatorShown( true );
setSortIndicator( -1, Qt::AscendingOrder ); if ( m_parent->guid().startsWith( "playlistview" ) ) // HACK
setSortIndicator( -1, Qt::AscendingOrder );
} }
else else
{ {

View File

@@ -449,6 +449,9 @@ TrackView::updateHoverIndex( const QPoint& pos )
repaint(); repaint();
} }
if ( m_model->style() == TrackModel::Short )
return;
if ( idx.column() == TrackModel::Artist || idx.column() == TrackModel::Album ) if ( idx.column() == TrackModel::Artist || idx.column() == TrackModel::Album )
{ {
if ( pos.x() > header()->sectionViewportPosition( idx.column() ) + header()->sectionSize( idx.column() ) - 16 && if ( pos.x() > header()->sectionViewportPosition( idx.column() ) + header()->sectionSize( idx.column() ) - 16 &&