Version: 2.2.2 (using KDE 4.4.1) OS: Linux Installed from: Archlinux Packages Minor bug: when I trigger the Stop playing after current track with the keyboard shortcut (either 'local' or global shortcut), the stop icon does not appear at the current track. When I hover the track with the mouse, it is properly repainted.
Still present in current 2.3-git: the Global Shortcut Meta+Shift+V stops after current track, but there is no visual indicator in the track. Either hovering the mouse on that track or any other nearby track makes the stop button appear.
commit d55d35a8e705c1bb256c84d7cc9b4ecc7e2b8d75 Author: Nikolaj Hald Nielsen <nhn@kde.org> Date: Mon Mar 15 08:40:49 2010 +0100 Trigger a repaint of The Playlist when using a shortcut to set/unset "stop after this track" BUG: 230569 diff --git a/src/ActionClasses.cpp b/src/ActionClasses.cpp index 1b0b23c..c528e50 100644 --- a/src/ActionClasses.cpp +++ b/src/ActionClasses.cpp @@ -537,11 +537,13 @@ StopPlayingAfterCurrentTrackAction::stopPlayingAfterCurrentTrack() { The::playlistActions()->setStopAfterMode( Playlist::StopAfterCurrent ); The::playlistActions()->setTrackToBeLast( Playlist::ModelStack::instance()->source()->activeId() ); + The::playlistActions()->repaintPlaylist(); Amarok::OSD::instance()->setImage( QImage( KIconLoader::global()->iconPath( "amarok", -KIconLoader::SizeHuge ) ) ); Amarok::OSD::instance()->OSDWidget::show( i18n( "Stop after current track: On" ) ); } else { The::playlistActions()->setStopAfterMode( Playlist::StopNever ); The::playlistActions()->setTrackToBeLast( 0 ); + The::playlistActions()->repaintPlaylist(); Amarok::OSD::instance()->setImage( QImage( KIconLoader::global()->iconPath( "amarok", -KIconLoader::SizeHuge ) ) ); Amarok::OSD::instance()->OSDWidget::show( i18n( "Stop after current track: Off" ) ); } diff --git a/src/playlist/PlaylistActions.cpp b/src/playlist/PlaylistActions.cpp index 18d50d0..dc58e0f 100644 --- a/src/playlist/PlaylistActions.cpp +++ b/src/playlist/PlaylistActions.cpp @@ -439,6 +439,12 @@ Playlist::Actions::normalizeDynamicPlaylist() } } +void +Playlist::Actions::repaintPlaylist() +{ + The::mainWindow()->playlistWidget()->currentView()->repaint(); +} + namespace The { diff --git a/src/playlist/PlaylistActions.h b/src/playlist/PlaylistActions.h index 196eac0..6e97a0d 100644 --- a/src/playlist/PlaylistActions.h +++ b/src/playlist/PlaylistActions.h @@ -111,6 +111,12 @@ public slots: void queue( QList<int> rows ); void dequeue( QList<int> rows ); + /** + * Repaint the playlist. + * Useful when triggering a change that will modify the visual appearance of one or more items in the playlist + */ + void repaintPlaylist(); + signals: void navigatorChanged();