author | simon <simon> | 2002-12-02 22:58:05 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 22:58:05 (UTC) |
commit | 779219b813f0eba82a8d9236fafd28dbafc594d1 (patch) (unidiff) | |
tree | cee0e78617f0e5c56c9ee8eaf44c41337faea977 | |
parent | b3bf297da8836a678a21f2ebe83e0f1961f91d97 (diff) | |
download | opie-779219b813f0eba82a8d9236fafd28dbafc594d1.zip opie-779219b813f0eba82a8d9236fafd28dbafc594d1.tar.gz opie-779219b813f0eba82a8d9236fafd28dbafc594d1.tar.bz2 |
- replaced QPixmap and QImage pointer usage with value usage
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.cpp | 38 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/videowidget.h | 10 |
2 files changed, 23 insertions, 25 deletions
diff --git a/noncore/multimedia/opieplayer2/videowidget.cpp b/noncore/multimedia/opieplayer2/videowidget.cpp index 41dddb7..c0039b1 100644 --- a/noncore/multimedia/opieplayer2/videowidget.cpp +++ b/noncore/multimedia/opieplayer2/videowidget.cpp | |||
@@ -99,8 +99,8 @@ MediaWidget( mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 | |||
99 | QString skinPath = "opieplayer2/skins/" + skin; | 99 | QString skinPath = "opieplayer2/skins/" + skin; |
100 | pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); | 100 | pixBg = QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); |
101 | imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); | 101 | imgUp = QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) ); |
102 | imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); | 102 | imgDn = QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) ); |
103 | 103 | ||
104 | imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 ); | 104 | imgButtonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); |
105 | imgButtonMask->fill( 0 ); | 105 | imgButtonMask.fill( 0 ); |
106 | 106 | ||
@@ -112,6 +112,6 @@ MediaWidget( mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 | |||
112 | QImage imgMask = masks[i]->convertToImage(); | 112 | QImage imgMask = masks[i]->convertToImage(); |
113 | uchar **dest = imgButtonMask->jumpTable(); | 113 | uchar **dest = imgButtonMask.jumpTable(); |
114 | for ( int y = 0; y < imgUp->height(); y++ ) { | 114 | for ( int y = 0; y < imgUp.height(); y++ ) { |
115 | uchar *line = dest[y]; | 115 | uchar *line = dest[y]; |
116 | for ( int x = 0; x < imgUp->width(); x++ ) { | 116 | for ( int x = 0; x < imgUp.width(); x++ ) { |
117 | if ( !qRed( imgMask.pixel( x, y ) ) ) | 117 | if ( !qRed( imgMask.pixel( x, y ) ) ) |
@@ -128,3 +128,3 @@ MediaWidget( mediaPlayerState, parent, name ), scaledWidth( 0 ), scaledHeight( 0 | |||
128 | 128 | ||
129 | setBackgroundPixmap( *pixBg ); | 129 | setBackgroundPixmap( pixBg ); |
130 | 130 | ||
@@ -152,6 +152,2 @@ VideoWidget::~VideoWidget() { | |||
152 | 152 | ||
153 | delete pixBg; | ||
154 | delete imgUp; | ||
155 | delete imgDn; | ||
156 | delete imgButtonMask; | ||
157 | for ( int i = 0; i < 7; i++ ) { | 153 | for ( int i = 0; i < 7; i++ ) { |
@@ -186,3 +182,3 @@ void VideoWidget::resizeEvent( QResizeEvent * ) { | |||
186 | slider->setFocusPolicy( QWidget::NoFocus ); | 182 | slider->setFocusPolicy( QWidget::NoFocus ); |
187 | slider->setBackgroundPixmap( *pixBg ); | 183 | slider->setBackgroundPixmap( pixBg ); |
188 | 184 | ||
@@ -195,4 +191,4 @@ void VideoWidget::resizeEvent( QResizeEvent * ) { | |||
195 | 191 | ||
196 | QPixmap *pixUp = combineVImageWithBackground( *imgUp, *pixBg, p ); | 192 | QPixmap *pixUp = combineVImageWithBackground( imgUp, pixBg, p ); |
197 | QPixmap *pixDn = combineVImageWithBackground( *imgDn, *pixBg, p ); | 193 | QPixmap *pixDn = combineVImageWithBackground( imgDn, pixBg, p ); |
198 | 194 | ||
@@ -293,5 +289,5 @@ void VideoWidget::mouseMoveEvent( QMouseEvent *event ) { | |||
293 | 289 | ||
294 | bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() | 290 | bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask.width() |
295 | && y < imgButtonMask->height() | 291 | && y < imgButtonMask.height() |
296 | && imgButtonMask->pixelIndex( x, y ) == i + 1 ); | 292 | && imgButtonMask.pixelIndex( x, y ) == i + 1 ); |
297 | 293 | ||
@@ -388,3 +384,3 @@ void VideoWidget::makeVisible() { | |||
388 | showMaximized(); | 384 | showMaximized(); |
389 | setBackgroundPixmap( *pixBg ); | 385 | setBackgroundPixmap( pixBg ); |
390 | QWidget *d = QApplication::desktop(); | 386 | QWidget *d = QApplication::desktop(); |
@@ -433,3 +429,3 @@ void VideoWidget::paintEvent( QPaintEvent * pe) { | |||
433 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); | 429 | p.translate( -pe->rect().topLeft().x(), -pe->rect().topLeft().y() ); |
434 | p.drawTiledPixmap( pe->rect(), *pixBg, pe->rect().topLeft() ); | 430 | p.drawTiledPixmap( pe->rect(), pixBg, pe->rect().topLeft() ); |
435 | for ( int i = 0; i < numVButtons; i++ ) { | 431 | for ( int i = 0; i < numVButtons; i++ ) { |
diff --git a/noncore/multimedia/opieplayer2/videowidget.h b/noncore/multimedia/opieplayer2/videowidget.h index 149c78e..ae0e687 100644 --- a/noncore/multimedia/opieplayer2/videowidget.h +++ b/noncore/multimedia/opieplayer2/videowidget.h | |||
@@ -37,2 +37,4 @@ | |||
37 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | #include <qimage.h> | ||
39 | #include <qpixmap.h> | ||
38 | #include "xinevideowidget.h" | 40 | #include "xinevideowidget.h" |
@@ -97,6 +99,6 @@ private: | |||
97 | // Ticker songInfo; | 99 | // Ticker songInfo; |
98 | QPixmap *pixBg; | 100 | QPixmap pixBg; |
99 | QImage *imgUp; | 101 | QImage imgUp; |
100 | QImage *imgDn; | 102 | QImage imgDn; |
101 | QImage *imgButtonMask; | 103 | QImage imgButtonMask; |
102 | QBitmap *masks[7]; | 104 | QBitmap *masks[7]; |