1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-18 23:09:42 +01:00

Added column and role for download status in Playable(Proxy)Model.

This commit is contained in:
Christian Muehlhaeuser 2015-03-11 05:22:14 +01:00
parent 87cacb14bd
commit 587d77cc77
3 changed files with 16 additions and 13 deletions

View File

@ -47,7 +47,7 @@ PlayableModel::init()
connect( AudioEngine::instance(), SIGNAL( started( Tomahawk::result_ptr ) ), SLOT( onPlaybackStarted( Tomahawk::result_ptr ) ), Qt::DirectConnection );
connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ), Qt::DirectConnection );
d->header << tr( "Artist" ) << tr( "Title" ) << tr( "Composer" ) << tr( "Album" ) << tr( "Track" ) << tr( "Duration" )
d->header << tr( "Artist" ) << tr( "Title" ) << tr( "Composer" ) << tr( "Album" ) << tr( "Download" ) << tr( "Track" ) << tr( "Duration" )
<< tr( "Bitrate" ) << tr( "Age" ) << tr( "Year" ) << tr( "Size" ) << tr( "Origin" ) << tr( "Accuracy" ) << tr( "Name" );
}
@ -874,6 +874,7 @@ PlayableModel::columnAlignment( int column ) const
case Filesize:
case Score:
case Year:
case Download:
return Qt::AlignHCenter;
break;

View File

@ -45,15 +45,16 @@ public:
Track = 1,
Composer = 2,
Album = 3,
AlbumPos = 4,
Duration = 5,
Bitrate = 6,
Age = 7,
Year = 8,
Filesize = 9,
Origin = 10,
Score = 11,
Name = 12
Download = 4,
AlbumPos = 5,
Duration = 6,
Bitrate = 7,
Age = 8,
Year = 9,
Filesize = 10,
Origin = 11,
Score = 12,
Name = 13,
};
enum PlayableRoles
@ -62,6 +63,7 @@ public:
TrackRole,
ComposerRole,
AlbumRole,
DownloadRole,
AlbumPosRole,
DurationRole,
BitrateRole,

View File

@ -49,7 +49,7 @@ PlayableProxyModel::PlayableProxyModel( QObject* parent )
PlayableProxyModel::setSourcePlayableModel( NULL );
m_headerStyle[ Fancy ] << PlayableModel::Name;
m_headerStyle[ Detailed ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize << PlayableModel::Origin << PlayableModel::Score;
m_headerStyle[ Detailed ] << PlayableModel::Artist << PlayableModel::Track << PlayableModel::Composer << PlayableModel::Album << PlayableModel::Download << PlayableModel::AlbumPos << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize << PlayableModel::Origin << PlayableModel::Score;
m_headerStyle[ Collection ] << PlayableModel::Name << PlayableModel::Composer << PlayableModel::Duration << PlayableModel::Bitrate << PlayableModel::Age << PlayableModel::Year << PlayableModel::Filesize << PlayableModel::Origin;
}
@ -612,7 +612,7 @@ PlayableProxyModel::columnCount( const QModelIndex& parent ) const
case Detailed:
default:
return 12;
return 13;
break;
}
}
@ -674,7 +674,7 @@ PlayableProxyModel::columnWeights() const
case Detailed:
default:
w << 0.15 << 0.15 << 0.12 << 0.12 << 0.05 << 0.05 << 0.05 << 0.05 << 0.05 << 0.05 << 0.09; // << 0.03;
w << 0.12 << 0.12 << 0.12 << 0.12 << 0.06 << 0.05 << 0.05 << 0.05 << 0.05 << 0.05 << 0.05 << 0.09; // << 0.03;
break;
}