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:
parent
50daf3acbf
commit
e2812be73a
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user