Diffstat (limited to 'core/multimedia/opieplayer/audiowidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/audiowidget.cpp | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/core/multimedia/opieplayer/audiowidget.cpp b/core/multimedia/opieplayer/audiowidget.cpp index a1973e9..b187cb4 100644 --- a/core/multimedia/opieplayer/audiowidget.cpp +++ b/core/multimedia/opieplayer/audiowidget.cpp @@ -76,7 +76,7 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : QWidget( parent, name, f ), songInfo( this ), slider( Qt::Horizontal, this ), time( this ) { setCaption( tr("OpiePlayer") ); - qDebug("<<<<<audioWidget"); + // qDebug("<<<<<audioWidget"); Config cfg("OpiePlayer"); cfg.setGroup("Options"); @@ -90,7 +90,7 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists()) skinPath = "opieplayer2/skins/default"; - qDebug("skin path " + skinPath); + // qDebug("skin path " + skinPath); pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) ); imgUp = new QImage( Resource::loadImage( QString("%1/skin_up").arg(skinPath) ) ); @@ -160,22 +160,23 @@ AudioWidget::AudioWidget(QWidget* parent, const char* name, WFlags f) : setLooping( mediaPlayerState->fullscreen() ); // setPaused( mediaPlayerState->paused() ); setPlaying( mediaPlayerState->playing() ); - +this->setFocus(); } AudioWidget::~AudioWidget() { + // setPlaying( false); for ( int i = 0; i < 10; i++ ) { - delete buttonPixUp[i]; - delete buttonPixDown[i]; + if(buttonPixUp[i]) delete buttonPixUp[i]; + if(buttonPixDown[i]) delete buttonPixDown[i]; } - delete pixBg; - delete imgUp; - delete imgDn; - delete imgButtonMask; + if(pixBg) delete pixBg; + if(imgUp) delete imgUp; + if(imgDn) delete imgDn; + if(imgButtonMask) delete imgButtonMask; for ( int i = 0; i < 10; i++ ) { - delete masks[i]; + if(masks[i]) delete masks[i]; } } @@ -279,6 +280,7 @@ void AudioWidget::setView( char view ) { killTimers(); hide(); } + } @@ -290,7 +292,8 @@ static QString timeAsString( long length ) { } void AudioWidget::updateSlider( long i, long max ) { - time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); +this->setFocus(); + time.setText( timeAsString( i ) + " / " + timeAsString( max ) ); if ( max == 0 ) return; @@ -357,19 +360,19 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { bool isOnButton = ( x > 0 && y > 0 && x < imgButtonMask->width() && y < imgButtonMask->height() && imgButtonMask->pixelIndex( x, y ) == i + 1 ); - if ( isOnButton && i == AudioVolumeUp ) - qDebug("on up"); +// if ( isOnButton && i == AudioVolumeUp ) +// qDebug("on up"); if ( isOnButton && !audioButtons[i].isHeld ) { audioButtons[i].isHeld = TRUE; toggleButton(i); switch (i) { case AudioVolumeUp: - qDebug("more clicked"); + // qDebug("more clicked"); emit moreClicked(); return; case AudioVolumeDown: - qDebug("less clicked"); + // qDebug("less clicked"); emit lessClicked(); return; case AudioForward: |