From 18d9360ad3728a5cf4007473a352287c2b6fd8ff Mon Sep 17 00:00:00 2001 From: Leo Franchi Date: Fri, 23 Sep 2011 10:49:59 -0400 Subject: [PATCH] Fix crash and shrink headphones --- src/sourcetree/sourcedelegate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sourcetree/sourcedelegate.cpp b/src/sourcetree/sourcedelegate.cpp index 17d299f12..3bb852677 100644 --- a/src/sourcetree/sourcedelegate.cpp +++ b/src/sourcetree/sourcedelegate.cpp @@ -201,7 +201,7 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co if ( !pm.isNull() ) { QRect pmRect = textRect; - pmRect.setTop( pmRect.bottom() - painter->fontMetrics().height() - 3 ); + pmRect.setTop( pmRect.bottom() - painter->fontMetrics().height() + 3 ); pmRect.setRight( pmRect.left() + pmRect.height() ); // tDebug() << "DOING HEADPHONES RECT:" << pmRect; painter->drawPixmap( pmRect, pm.scaledToHeight( pmRect.height(), Qt::SmoothTransformation ) ); @@ -405,6 +405,7 @@ SourceDelegate::editorEvent ( QEvent* event, QAbstractItemModel* model, const QS { CollectionItem* colItem = qobject_cast< CollectionItem* >( index.data( SourcesModel::SourceTreeItemRole ).value< SourceTreeItem* >() ); Q_ASSERT( colItem ); + if ( !colItem->source().isNull() && !colItem->source()->currentTrack().isNull() && !colItem->source()->isLocal() ) { QMouseEvent* ev = static_cast< QMouseEvent* >( event );