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

* Don't remove current index when restarting a track by activating it directly.

* Don't create new playlist revisions for a list that doesn't belong to you.
This commit is contained in:
Christian Muehlhaeuser 2011-11-22 01:52:24 +01:00
parent 0f21cde318
commit eba1505e1d
3 changed files with 2 additions and 17 deletions

View File

@ -401,7 +401,7 @@ PlaylistModel::endPlaylistChanges()
Q_ASSERT( false );
}
if ( m_playlist.isNull() )
if ( m_playlist.isNull() || !m_playlist->author()->isLocal() )
return;
QList<plentry_ptr> l = playlistEntries();

View File

@ -39,16 +39,13 @@ TrackModel::TrackModel( QObject* parent )
, m_readOnly( true )
, m_style( Detailed )
{
qDebug() << Q_FUNC_INFO;
connect( AudioEngine::instance(), SIGNAL( finished( Tomahawk::result_ptr ) ), SLOT( onPlaybackFinished( Tomahawk::result_ptr ) ), Qt::DirectConnection );
connect( AudioEngine::instance(), SIGNAL( stopped() ), SLOT( onPlaybackStopped() ), Qt::DirectConnection );
}
TrackModel::~TrackModel()
{
// delete m_rootItem;
delete m_rootItem;
}
@ -478,17 +475,6 @@ TrackModel::itemFromIndex( const QModelIndex& index ) const
}
void
TrackModel::onPlaybackFinished( const Tomahawk::result_ptr& result )
{
TrackModelItem* oldEntry = itemFromIndex( m_currentIndex );
if ( oldEntry && !oldEntry->query().isNull() && oldEntry->query()->results().contains( result ) )
{
oldEntry->setIsPlaying( false );
}
}
void
TrackModel::onPlaybackStopped()
{

View File

@ -126,7 +126,6 @@ public slots:
virtual void setShuffled( bool /*shuffled*/ ) {}
private slots:
void onPlaybackFinished( const Tomahawk::result_ptr& result );
void onPlaybackStopped();
private: