1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-02 04:10:20 +02:00

TWK-216: reset the proper view mode toggle when changing to a different view mode automatically

This commit is contained in:
Leo Franchi
2011-08-14 17:44:43 -04:00
parent 7d2c284a3e
commit ae32b0b368
2 changed files with 17 additions and 4 deletions

View File

@@ -971,6 +971,19 @@ ViewManager::showCurrentTrack()
{
setPage( page );
page->jumpToCurrentTrack();
// reset the correct mode, if the user has changed it since
if ( dynamic_cast< CollectionView* >( page ) )
m_currentMode = PlaylistInterface::Flat;
else if ( dynamic_cast< AlbumView* >( page ) )
m_currentMode = PlaylistInterface::Album;
else if ( dynamic_cast< ArtistView* >( page ) )
m_currentMode = PlaylistInterface::Tree;
else
return;
emit modeChanged( (PlaylistInterface::ViewMode)m_currentMode );
}
}

View File

@@ -141,7 +141,7 @@ Portfwd::add( unsigned short port, unsigned short internal_port )
sprintf(port_str, "%d", port);
sprintf(port_str_internal, "%d", internal_port);
r = UPNP_AddPortMapping(urls->controlURL, data->CIF.servicetype,
r = UPNP_AddPortMapping(urls->controlURL, data->first.servicetype,
port_str, port_str_internal, m_lanip.c_str(), "tomahawk", "TCP", NULL);
if(r!=0)
{