1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-25 10:19:41 +01: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 ) );
setSortingEnabled( true );
sortByColumn( 0, Qt::AscendingOrder );
setDragDropMode( QAbstractItemView::DragOnly );
setAcceptDrops( false );
}
@ -65,9 +62,7 @@ CollectionView::setTrackModel( TrackModel* model )
setColumnHidden( TrackModel::Origin, true ); // Hide origin column per default
setGuid( QString( "collectionview/%1" ).arg( model->columnCount() ) );
setSortingEnabled( true );
sortByColumn( 0, Qt::AscendingOrder );
sortByColumn( TrackModel::Artist, Qt::AscendingOrder );
connect( model, SIGNAL( trackCountChanged( unsigned int ) ), SLOT( onTrackCountChanged( unsigned int ) ) );
}

View File

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

View File

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