From 174c4a427750a3829ffd81a87454be8abf61ee30 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 09 Dec 2002 14:41:19 +0000 Subject: - merged the two button setup loops --- (limited to 'noncore/multimedia') diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index 87e06ee..c148820 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -86,12 +86,6 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye MediaWidget( playList, mediaPlayerState, parent, name ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ), audioSliderBeingMoved( false ) { - for ( uint i = 0; i < buttonCount; ++i ) { - Button button; - button.type = skinInfo[ i ].type; - buttons.push_back( button ); - } - setCaption( tr("OpiePlayer") ); Config cfg("OpiePlayer"); @@ -108,12 +102,15 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye buttonMask = QImage( imgUp.width(), imgUp.height(), 8, 255 ); buttonMask.fill( 0 ); - for ( uint i = 0; i < buttons.size(); i++ ) { + for ( uint i = 0; i < buttonCount; i++ ) { + Button button; + button.type = skinInfo[ i ].type; + QString filename = QString( QPEApplication::qpeDir() + "/pics/" + skinPath + "/skin_mask_" + skinInfo[i].fileName + ".png" ); - buttons[ i ].mask =QBitmap( filename ); + button.mask =QBitmap( filename ); - if ( !buttons[i].mask.isNull() ) { - QImage imgMask = buttons[i].mask.convertToImage(); + if ( !button.mask.isNull() ) { + QImage imgMask = button.mask.convertToImage(); uchar **dest = buttonMask.jumpTable(); for ( int y = 0; y < imgUp.height(); y++ ) { uchar *line = dest[y]; @@ -123,6 +120,7 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye } } + buttons.push_back( button ); } setBackgroundPixmap( pixBg ); -- cgit v0.9.0.2