mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
* Fixed TWK-469: Added album position as a TrackModel column.
This commit is contained in:
@@ -88,7 +88,7 @@ TrackHeader::checkState()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
QList< double > m_columnWeights;
|
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++ )
|
for ( int i = 0; i < count() - 1; i++ )
|
||||||
{
|
{
|
||||||
|
@@ -93,7 +93,7 @@ TrackModel::columnCount( const QModelIndex& parent ) const
|
|||||||
|
|
||||||
case Detailed:
|
case Detailed:
|
||||||
default:
|
default:
|
||||||
return 10;
|
return 11;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -205,6 +205,10 @@ TrackModel::data( const QModelIndex& index, int role ) const
|
|||||||
case Score:
|
case Score:
|
||||||
return query->results().first()->score();
|
return query->results().first()->score();
|
||||||
break;
|
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 );
|
Q_UNUSED( orientation );
|
||||||
QStringList headers;
|
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 )
|
if ( role == Qt::DisplayRole && section >= 0 )
|
||||||
{
|
{
|
||||||
return headers.at( section );
|
return headers.at( section );
|
||||||
|
@@ -49,7 +49,8 @@ public:
|
|||||||
Year = 6,
|
Year = 6,
|
||||||
Filesize = 7,
|
Filesize = 7,
|
||||||
Origin = 8,
|
Origin = 8,
|
||||||
Score = 9
|
Score = 9,
|
||||||
|
AlbumPos = 10
|
||||||
};
|
};
|
||||||
|
|
||||||
explicit TrackModel( QObject* parent = 0 );
|
explicit TrackModel( QObject* parent = 0 );
|
||||||
|
Reference in New Issue
Block a user