author | simon <simon> | 2002-12-09 13:35:46 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 13:35:46 (UTC) |
commit | d1324d850a3c8269bd6009de6fdf6c321954b371 (patch) (unidiff) | |
tree | f9effa74f69b06b8e9e7b89c3317c871c2bd81d6 | |
parent | 235ef0e11bfd61c0debb530de8598ae38a396914 (diff) | |
download | opie-d1324d850a3c8269bd6009de6fdf6c321954b371.zip opie-d1324d850a3c8269bd6009de6fdf6c321954b371.tar.gz opie-d1324d850a3c8269bd6009de6fdf6c321954b371.tar.bz2 |
- use a vector to store the masks
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.cpp | 19 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/audiowidget.h | 4 |
2 files changed, 12 insertions, 11 deletions
diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index adef247..fe7ddc1 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp | |||
@@ -112,8 +112,10 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye | |||
112 | 112 | ||
113 | for ( int i = 0; i < 10; i++ ) { | 113 | masks.reserve( 10 ); |
114 | |||
115 | for ( uint i = 0; i < masks.capacity(); i++ ) { | ||
114 | QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png" ); | 116 | QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skin_mask_file_names[i] + ".png" ); |
115 | masks[i] = new QBitmap( filename ); | 117 | masks.push_back( QBitmap( filename ) ); |
116 | 118 | ||
117 | if ( !masks[i]->isNull() ) { | 119 | if ( !masks[i].isNull() ) { |
118 | QImage imgMask = masks[i]->convertToImage(); | 120 | QImage imgMask = masks[i].convertToImage(); |
119 | uchar **dest = buttonMask.jumpTable(); | 121 | uchar **dest = buttonMask.jumpTable(); |
@@ -184,5 +186,2 @@ AudioWidget::~AudioWidget() { | |||
184 | } | 186 | } |
185 | for ( int i = 0; i < 10; i++ ) { | ||
186 | delete masks[i]; | ||
187 | } | ||
188 | // mediaPlayerState->setPlaying(false); | 187 | // mediaPlayerState->setPlaying(false); |
@@ -227,7 +226,7 @@ void AudioWidget::resizeEvent( QResizeEvent * ) { | |||
227 | for ( int i = 0; i < 10; i++ ) { | 226 | for ( int i = 0; i < 10; i++ ) { |
228 | if ( !masks[i]->isNull() ) { | 227 | if ( !masks[i].isNull() ) { |
229 | delete buttonPixUp[i]; | 228 | delete buttonPixUp[i]; |
230 | delete buttonPixDown[i]; | 229 | delete buttonPixDown[i]; |
231 | buttonPixUp[i] = maskPixToMask( pixUp, *masks[i] ); | 230 | buttonPixUp[i] = maskPixToMask( pixUp, masks[i] ); |
232 | buttonPixDown[i] = maskPixToMask( pixDn, *masks[i] ); | 231 | buttonPixDown[i] = maskPixToMask( pixDn, masks[i] ); |
233 | } | 232 | } |
diff --git a/noncore/multimedia/opieplayer2/audiowidget.h b/noncore/multimedia/opieplayer2/audiowidget.h index 8426490..bc7262c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.h +++ b/noncore/multimedia/opieplayer2/audiowidget.h | |||
@@ -93,2 +93,4 @@ private slots: | |||
93 | private: | 93 | private: |
94 | typedef std::vector<QBitmap> MaskVector; | ||
95 | |||
94 | void setToggleButton( int, bool ); | 96 | void setToggleButton( int, bool ); |
@@ -100,3 +102,3 @@ private: | |||
100 | QImage imgDn; | 102 | QImage imgDn; |
101 | QBitmap *masks[10]; | 103 | MaskVector masks; |
102 | QPixmap *buttonPixUp[10]; | 104 | QPixmap *buttonPixUp[10]; |