]> git.sur5r.net Git - minitube/commitdiff
Paint play icon only if there is a thumb
authorFlavio Tordini <flavio.tordini@gmail.com>
Thu, 27 Aug 2009 21:40:32 +0000 (23:40 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Thu, 27 Aug 2009 21:40:32 +0000 (23:40 +0200)
src/playlist/PrettyItemDelegate.cpp

index 9e0348da705e8cfa2623f54572fe9f23966b6883..59843fe60c21808f35154214b234e5c39afe4991 100644 (file)
@@ -81,11 +81,13 @@ void PrettyItemDelegate::paintBody( QPainter* painter,
     const Video *video = videoPointer.data();
 
     // thumb
-    painter->drawImage(QRect(0, 0, THUMB_WIDTH, THUMB_HEIGHT), video->thumbnail());
+    if (!video->thumbnail().isNull()) {
+        painter->drawImage(QRect(0, 0, THUMB_WIDTH, THUMB_HEIGHT), video->thumbnail());
 
-    // play icon overlayed on the thumb
-    if (isActive)
-        paintPlayIcon(painter);
+        // play icon overlayed on the thumb
+        if (isActive)
+            paintPlayIcon(painter);
+    }
 
     // time
     QString timeString;