Commit d2c77d11 authored by Sergey Ivanov's avatar Sergey Ivanov
Browse files

Fix crash during iPod track removal.

BUG: 253088
parent a98c7e0a
......@@ -5,6 +5,7 @@ Amarok ChangeLog
VERSION 2.4.1
BUGFIXES:
* Fix crash during iPod track removal. (BR 253088)
* Relative paths support for XSPF playlists. (BR 264147)
* Fix incorrect handling of "Various Artists" node by Collection Browser,
now selection of this node returns "Various Artists" tracks instead of
......
......@@ -1415,11 +1415,11 @@ IpodHandler::deleteFile( const KUrl &url )
m_jobcounter++;
if( m_jobcounter < IPOD_MAX_CONCURRENT_JOBS )
removeNextTrackFromDevice();
connect( job, SIGNAL( result( KJob * ) ),
this, SLOT( fileDeleted( KJob * ) ) );
if( m_jobcounter < IPOD_MAX_CONCURRENT_JOBS )
removeNextTrackFromDevice();
return;
}
......@@ -1428,8 +1428,11 @@ void
IpodHandler::fileDeleted( KJob *job ) //SLOT
{
DEBUG_BLOCK
if( job->error() )
debug() << "file deletion failed: " << job->errorText();
// HACK
// Filtrate #111 error (File or directory doesn't exist)
// Since It always present, we can ignore this "error"
if( job->error() && job->error() != 111 )
debug() << "file deletion failed: " << job->errorString();
m_jobcounter--;
......
......@@ -871,12 +871,12 @@ MediaDeviceAlbum::hasImage( int size ) const
QImage
MediaDeviceAlbum::image( int size ) const
{
if( m_name.isEmpty() || !m_hasImage )
if( m_name.isEmpty() || !m_hasImage || m_tracks.isEmpty() )
return Meta::Album::image( size );
if( m_image.isNull() && m_artworkCapability )
{
MediaDeviceTrackPtr track = MediaDeviceTrackPtr::dynamicCast( m_tracks.first() );
MediaDeviceTrackPtr track = MediaDeviceTrackPtr::staticCast( m_tracks.first() );
m_image = m_artworkCapability->getCover( track );
m_hasImage = m_image.isNull();
m_hasImageChecked = true;
......
......@@ -638,8 +638,7 @@ MediaDeviceHandler::removeNextTrackFromDevice()
{
// Pop the track off the front of the list
track = m_tracksToDelete.first();
m_tracksToDelete.removeFirst();
track = m_tracksToDelete.takeFirst();
// Remove the track
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment