author | simon <simon> | 2002-12-09 13:40:24 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 13:40:24 (UTC) |
commit | d0d993b584bba77905955466897a50cea758103c (patch) (side-by-side diff) | |
tree | fabf38ac7ef2d454a311bd2d264ca1eeab02e2b0 | |
parent | d1324d850a3c8269bd6009de6fdf6c321954b371 (diff) | |
download | opie-d0d993b584bba77905955466897a50cea758103c.zip opie-d0d993b584bba77905955466897a50cea758103c.tar.gz opie-d0d993b584bba77905955466897a50cea758103c.tar.bz2 |
- buttonPixUp/Down are now vectors, too
- removed unused and uninitialized pixmaps array
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 22 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 6 |
2 files changed, 10 insertions, 18 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index fe7ddc1..2081b4f 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -130,8 +130,6 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye } - for ( int i = 0; i < 10; i++ ) { - buttonPixUp[i] = 0l; - buttonPixDown[i] = 0l; - } + buttonPixUp.resize( masks.size(), QPixmap() ); + buttonPixDown.resize( masks.size(), QPixmap() ); setBackgroundPixmap( pixBg ); @@ -181,8 +179,4 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye AudioWidget::~AudioWidget() { - for ( int i = 0; i < 10; i++ ) { - delete buttonPixUp[i]; - delete buttonPixDown[i]; - } // mediaPlayerState->setPlaying(false); } @@ -199,7 +193,7 @@ QPixmap combineImageWithBackground( QImage img, QPixmap bg, QPoint offset ) { -QPixmap *maskPixToMask( QPixmap pix, QBitmap mask ) { - QPixmap *pixmap = new QPixmap( pix ); - pixmap->setMask( mask ); +QPixmap maskPixToMask( QPixmap pix, QBitmap mask ) { + QPixmap pixmap( pix ); + pixmap.setMask( mask ); return pixmap; } @@ -226,6 +220,4 @@ void AudioWidget::resizeEvent( QResizeEvent * ) { for ( int i = 0; i < 10; i++ ) { if ( !masks[i].isNull() ) { - delete buttonPixUp[i]; - delete buttonPixDown[i]; buttonPixUp[i] = maskPixToMask( pixUp, masks[i] ); buttonPixDown[i] = maskPixToMask( pixDn, masks[i] ); @@ -333,7 +325,7 @@ void AudioWidget::setToggleButton( int i, bool down ) { void AudioWidget::paintButton( QPainter &p, int i ) { if ( buttons[i].isDown ) { - p.drawPixmap( upperLeftOfButtonMask, *buttonPixDown[i] ); + p.drawPixmap( upperLeftOfButtonMask, buttonPixDown[i] ); } else { - p.drawPixmap( upperLeftOfButtonMask, *buttonPixUp[i] ); + p.drawPixmap( upperLeftOfButtonMask, buttonPixUp[i] ); } } diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index bc7262c..73ce1e5 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h @@ -93,4 +93,5 @@ private slots: private: typedef std::vector<QBitmap> MaskVector; + typedef std::vector<QPixmap> PixmapVector; void setToggleButton( int, bool ); @@ -102,8 +103,7 @@ private: QImage imgDn; MaskVector masks; - QPixmap *buttonPixUp[10]; - QPixmap *buttonPixDown[10]; + PixmapVector buttonPixUp; + PixmapVector buttonPixDown; - QPixmap *pixmaps[4]; OTicker songInfo; QSlider slider; |