1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-17 03:45:56 +01:00

Oops, fix another crash in the smart playlist preview view when moodbars are displayed

This commit is contained in:
David Sansome 2012-05-31 14:17:36 +01:00
parent 836a2b0c89
commit eeb617e892

View File

@ -255,11 +255,12 @@ void MoodbarItemDelegate::ImageLoaded(const QUrl& url, QFutureWatcher<QImage>* w
// Update all the indices with the new pixmap. // Update all the indices with the new pixmap.
foreach (const QPersistentModelIndex& index, data->indexes_) { foreach (const QPersistentModelIndex& index, data->indexes_) {
if (index.isValid() && index.sibling(index.row(), Playlist::Column_Filename).data().toUrl() == url) { if (index.isValid() && index.sibling(index.row(), Playlist::Column_Filename).data().toUrl() == url) {
Q_ASSERT(index.model() == filter); QModelIndex source_index = index;
QModelIndex source_index(filter->mapToSource(index)); if (index.model() == filter) {
source_index = filter->mapToSource(source_index);
}
Q_ASSERT(source_index.model() == playlist); Q_ASSERT(source_index.model() == playlist);
playlist->MoodbarUpdated(source_index); playlist->MoodbarUpdated(source_index);
} }
} }