Skip to content

Commit

Permalink
TWK-216: reset the proper view mode toggle when changing to a differe…
Browse files Browse the repository at this point in the history
…nt view mode automatically
  • Loading branch information
lfranchi committed Aug 14, 2011
1 parent 7d2c284 commit ae32b0b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
13 changes: 13 additions & 0 deletions src/libtomahawk/viewmanager.cpp
Expand Up @@ -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 changes: 4 additions & 4 deletions thirdparty/libportfwd/src/portfwd.cpp
Expand Up @@ -99,7 +99,7 @@ Portfwd::init(unsigned int timeout)
return false;
}
m_lanip = std::string(lanaddr);

freeUPNPDevlist(devlist);
get_status();
return true;
Expand All @@ -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
Expand All @@ -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)
{
Expand Down

0 comments on commit ae32b0b

Please sign in to comment.