mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 05:37:29 +02:00
TWK-216: reset the proper view mode toggle when changing to a different view mode automatically
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
|
8
thirdparty/libportfwd/src/portfwd.cpp
vendored
8
thirdparty/libportfwd/src/portfwd.cpp
vendored
@@ -99,7 +99,7 @@ Portfwd::init(unsigned int timeout)
|
||||
return false;
|
||||
}
|
||||
m_lanip = std::string(lanaddr);
|
||||
|
||||
|
||||
freeUPNPDevlist(devlist);
|
||||
get_status();
|
||||
return true;
|
||||
@@ -117,8 +117,8 @@ Portfwd::get_status()
|
||||
|
||||
// get external IP adress
|
||||
char ip[16];
|
||||
if( 0 != UPNP_GetExternalIPAddress( urls->controlURL,
|
||||
data->CIF.servicetype,
|
||||
if( 0 != UPNP_GetExternalIPAddress( urls->controlURL,
|
||||
data->CIF.servicetype,
|
||||
(char*)&ip ) )
|
||||
{
|
||||
m_externalip = ""; //failed
|
||||
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user