1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-17 22:38:33 +01:00

Prepend tracks to inbox, and avoid crash.

This commit is contained in:
Teo Mrnjavac 2013-04-09 10:13:48 +02:00
parent 2dd5515392
commit fd60cf4a5b
2 changed files with 4 additions and 3 deletions

View File

@ -98,9 +98,10 @@ DatabaseCommand_ShareTrack::postCommitHook()
return;
QMetaObject::invokeMethod( ViewManager::instance()->inboxModel(),
"appendQuery",
"insertQuery",
Qt::QueuedConnection,
Q_ARG( const Tomahawk::query_ptr&, m_query ) );
Q_ARG( const Tomahawk::query_ptr&, m_query ),
Q_ARG( int, 0 ) /*row*/ );
}

View File

@ -543,7 +543,7 @@ PlayableProxyModel::data( const QModelIndex& index, int role ) const
return QVariant();
if ( !m_headerStyle.contains( m_style ) )
return QVariant();
if ( index.column() < 0 )
if ( index.column() < 0 || index.column() >= m_headerStyle[ m_style ].count() )
return QVariant();
PlayableModel::Columns col = m_headerStyle[ m_style ].at( index.column() );