From 8eb71085cec5e24e20b441ceae9e5e66448405b3 Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 09 Dec 2002 16:31:17 +0000 Subject: - less indexing --- diff --git a/noncore/multimedia/opieplayer2/audiowidget.cpp b/noncore/multimedia/opieplayer2/audiowidget.cpp index c3e206c..3838e2c 100644 --- a/noncore/multimedia/opieplayer2/audiowidget.cpp +++ b/noncore/multimedia/opieplayer2/audiowidget.cpp @@ -117,7 +117,7 @@ AudioWidget::AudioWidget( PlayListWidget &playList, MediaPlayerState &mediaPlaye uchar *line = dest[y]; for ( int x = 0; x < imgUp.width(); x++ ) if ( !qRed( imgMask.pixel( x, y ) ) ) - line[x] = i + 1; + line[x] = button.command + 1; } } @@ -338,15 +338,16 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { for ( unsigned int i = 0; i < buttons.size(); i++ ) { Button &button = buttons[ i ]; + Command command = button.command; if ( event->state() == QMouseEvent::LeftButton ) { // The test to see if the mouse click is inside the button or not - bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, i ); + bool isOnButton = isOverButton( event->pos() - upperLeftOfButtonMask, command ); if ( isOnButton && !button.isHeld ) { button.isHeld = TRUE; toggleButton( button ); - switch (i) { + switch ( command ) { case VolumeUp: emit moreClicked(); return; @@ -359,6 +360,7 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { case Back: emit backClicked(); return; + default: break; } } else if ( !isOnButton && button.isHeld ) { button.isHeld = FALSE; @@ -371,7 +373,7 @@ void AudioWidget::mouseMoveEvent( QMouseEvent *event ) { setToggleButton( button, FALSE ); } qDebug("mouseEvent %d", i); - handleCommand( static_cast( i ), button.isDown ); + handleCommand( command, button.isDown ); } } } -- cgit v0.9.0.2