1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-24 09:49:42 +01:00

* Remove mode handling from ViewManager.

This commit is contained in:
Christian Muehlhaeuser 2012-11-28 12:55:49 +01:00
parent 5b213f1ac4
commit a0b5006a73
2 changed files with 0 additions and 53 deletions

View File

@ -121,7 +121,6 @@ ViewManager::ViewManager( QObject* parent )
ViewManager::~ViewManager()
{
saveCurrentPlaylistSettings();
delete m_whatsHotWidget;
delete m_newReleasesWidget;
delete m_welcomeWidget;
@ -525,8 +524,6 @@ ViewManager::setPage( ViewPage* page, bool trackHistory )
if ( page == m_currentPage )
return;
// save the old playlist shuffle state in config before we change playlists
saveCurrentPlaylistSettings();
unlinkPlaylist();
if ( m_stack->indexOf( page->widget() ) < 0 )
@ -606,29 +603,6 @@ ViewManager::unlinkPlaylist()
}
void
ViewManager::saveCurrentPlaylistSettings()
{
TomahawkSettings* s = TomahawkSettings::instance();
Tomahawk::playlist_ptr pl = playlistForInterface( currentPlaylistInterface() );
if ( !pl.isNull() )
{
s->setShuffleState( pl->guid(), currentPlaylistInterface()->shuffled() );
s->setRepeatMode( pl->guid(), currentPlaylistInterface()->repeatMode() );
}
else
{
Tomahawk::dynplaylist_ptr dynPl = dynamicPlaylistForInterface( currentPlaylistInterface() );
if ( !dynPl.isNull() )
{
s->setShuffleState( dynPl->guid(), currentPlaylistInterface()->shuffled() );
s->setRepeatMode( dynPl->guid(), currentPlaylistInterface()->repeatMode() );
}
}
}
void
ViewManager::updateView()
{
@ -672,31 +646,6 @@ ViewManager::updateView()
}
m_infobar->setLongDescription( currentPage()->longDescription() );
m_infobar->setPixmap( currentPage()->pixmap() );
// turn on shuffle/repeat mode for the new playlist view if specified in config
loadCurrentPlaylistSettings();
}
void
ViewManager::loadCurrentPlaylistSettings()
{
TomahawkSettings* s = TomahawkSettings::instance();
Tomahawk::playlist_ptr pl = playlistForInterface( currentPlaylistInterface() );
if ( !pl.isNull() )
{
currentPlaylistInterface()->setShuffled( s->shuffleState( pl->guid() ));
currentPlaylistInterface()->setRepeatMode( s->repeatMode( pl->guid() ));
}
else
{
Tomahawk::dynplaylist_ptr dynPl = dynamicPlaylistForInterface( currentPlaylistInterface() );
if ( !dynPl.isNull() )
{
currentPlaylistInterface()->setShuffled( s->shuffleState( dynPl->guid() ));
}
}
}

View File

@ -175,8 +175,6 @@ private:
void setPage( Tomahawk::ViewPage* page, bool trackHistory = true );
void updateView();
void unlinkPlaylist();
void saveCurrentPlaylistSettings();
void loadCurrentPlaylistSettings();
Tomahawk::playlist_ptr playlistForInterface( Tomahawk::playlistinterface_ptr plInterface ) const;
Tomahawk::dynplaylist_ptr dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr plInterface ) const;