1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* previous- & nextTrackAvailable signal now emit a boolean parameter indicating whether there's another track available.

This commit is contained in:
Christian Muehlhaeuser 2012-12-23 08:09:00 +01:00
parent 50daf3acbf
commit e2812be73a
2 changed files with 6 additions and 18 deletions

View File

@ -184,35 +184,23 @@ PlaylistInterface::onItemsChanged()
Tomahawk::result_ptr prevResult = siblingResult( -1, m_currentIndex );
Tomahawk::result_ptr nextResult = siblingResult( 1, m_currentIndex );
if ( prevResult )
{
bool avail = prevResult->toQuery()->playable();
bool avail = prevResult && prevResult->toQuery()->playable();
if ( avail != m_prevAvail )
{
m_prevAvail = avail;
emit previousTrackAvailable();
emit previousTrackAvailable( avail );
}
}
else if ( m_prevAvail )
{
m_prevAvail = false;
emit previousTrackAvailable();
}
if ( nextResult )
{
bool avail = nextResult->toQuery()->playable();
bool avail = nextResult && nextResult->toQuery()->playable();
if ( avail != m_nextAvail )
{
m_nextAvail = avail;
emit nextTrackAvailable();
emit nextTrackAvailable( avail );
}
}
else if ( m_nextAvail )
{
m_nextAvail = false;
emit nextTrackAvailable();
}
}

View File

@ -96,8 +96,8 @@ signals:
void shuffleModeChanged( bool enabled );
void latchModeChanged( Tomahawk::PlaylistModes::LatchMode mode );
void previousTrackAvailable();
void nextTrackAvailable();
void previousTrackAvailable( bool available );
void nextTrackAvailable( bool available );
void currentIndexChanged();