mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-23 01:09:42 +01:00
* Fixed TWK-469: Added album position as a TrackModel column.
This commit is contained in:
parent
c4fbb6e0a7
commit
ff10760838
@ -88,7 +88,7 @@ TrackHeader::checkState()
|
||||
else
|
||||
{
|
||||
QList< double > m_columnWeights;
|
||||
m_columnWeights << 0.20 << 0.20 << 0.18 << 0.05 << 0.05 << 0.05 << 0.05 << 0.05 << 0.10; // << 0.05;
|
||||
m_columnWeights << 0.18 << 0.18 << 0.17 << 0.05 << 0.05 << 0.05 << 0.05 << 0.05 << 0.10 << 0.05; // << 0.05;
|
||||
|
||||
for ( int i = 0; i < count() - 1; i++ )
|
||||
{
|
||||
|
@ -93,7 +93,7 @@ TrackModel::columnCount( const QModelIndex& parent ) const
|
||||
|
||||
case Detailed:
|
||||
default:
|
||||
return 10;
|
||||
return 11;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -205,6 +205,10 @@ TrackModel::data( const QModelIndex& index, int role ) const
|
||||
case Score:
|
||||
return query->results().first()->score();
|
||||
break;
|
||||
|
||||
case AlbumPos:
|
||||
return query->results().first()->albumpos();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -217,7 +221,7 @@ TrackModel::headerData( int section, Qt::Orientation orientation, int role ) con
|
||||
{
|
||||
Q_UNUSED( orientation );
|
||||
QStringList headers;
|
||||
headers << tr( "Artist" ) << tr( "Track" ) << tr( "Album" ) << tr( "Duration" ) << tr( "Bitrate" ) << tr( "Age" ) << tr( "Year" ) << tr( "Size" ) << tr( "Origin" ) << tr( "Score" );
|
||||
headers << tr( "Artist" ) << tr( "Title" ) << tr( "Album" ) << tr( "Duration" ) << tr( "Bitrate" ) << tr( "Age" ) << tr( "Year" ) << tr( "Size" ) << tr( "Origin" ) << tr( "Score" ) << tr( "Track" );
|
||||
if ( role == Qt::DisplayRole && section >= 0 )
|
||||
{
|
||||
return headers.at( section );
|
||||
|
@ -49,7 +49,8 @@ public:
|
||||
Year = 6,
|
||||
Filesize = 7,
|
||||
Origin = 8,
|
||||
Score = 9
|
||||
Score = 9,
|
||||
AlbumPos = 10
|
||||
};
|
||||
|
||||
explicit TrackModel( QObject* parent = 0 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user