-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 32 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 2 |
2 files changed, 12 insertions, 22 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 089ef6a..3baa087 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp @@ -120,7 +120,2 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye - for ( int i = 0; i < 7; i++ ) { - buttonPixUp[i] = NULL; - buttonPixDown[i] = NULL; - } - setBackgroundPixmap( pixBg ); @@ -142,7 +137,4 @@ VideoWidget::VideoWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye -VideoWidget::~VideoWidget() { - for ( int i = 0; i < 7; i++ ) { - delete buttonPixUp[i]; - delete buttonPixDown[i]; - } +VideoWidget::~VideoWidget() +{ } @@ -157,5 +149,5 @@ QPixmap *combineVImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { -QPixmap *maskVPixToMask( QPixmap pix, QBitmap mask ) { - QPixmap *pixmap = new QPixmap( pix ); - pixmap->setMask( mask ); +QPixmap maskVPixToMask( QPixmap pix, QBitmap mask ) { + QPixmap pixmap( pix ); + pixmap.setMask( mask ); return pixmap; @@ -189,6 +181,4 @@ void VideoWidget::resizeEvent( QResizeEvent * ) { if ( !button.mask.isNull() ) { - delete buttonPixUp[i]; - delete buttonPixDown[i]; - buttonPixUp[i] = maskVPixToMask( *pixUp, button.mask ); - buttonPixDown[i] = maskVPixToMask( *pixDn, button.mask ); + button.pixUp = maskVPixToMask( *pixUp, button.mask ); + button.pixDown = maskVPixToMask( *pixDn, button.mask ); } @@ -262,6 +252,8 @@ void VideoWidget::paintButton( QPainter &p, int i ) { - if ( buttons[i].isDown ) { - p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); + Button &button = buttons[ i ]; + + if ( button.isDown ) { + p.drawPixmap( upperLeftOfButtonMask, button.pixDown ); } else { - p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); + p.drawPixmap( upperLeftOfButtonMask, button.pixUp ); } diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index fd301f9..aeb6429 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h @@ -102,4 +102,2 @@ private: QImage imgDn; - QPixmap *buttonPixUp[7]; - QPixmap *buttonPixDown[7]; QString skin; |