mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 15:47:38 +02:00
* Remove mode handling from ViewManager.
This commit is contained in:
@@ -121,7 +121,6 @@ ViewManager::ViewManager( QObject* parent )
|
|||||||
|
|
||||||
ViewManager::~ViewManager()
|
ViewManager::~ViewManager()
|
||||||
{
|
{
|
||||||
saveCurrentPlaylistSettings();
|
|
||||||
delete m_whatsHotWidget;
|
delete m_whatsHotWidget;
|
||||||
delete m_newReleasesWidget;
|
delete m_newReleasesWidget;
|
||||||
delete m_welcomeWidget;
|
delete m_welcomeWidget;
|
||||||
@@ -525,8 +524,6 @@ ViewManager::setPage( ViewPage* page, bool trackHistory )
|
|||||||
if ( page == m_currentPage )
|
if ( page == m_currentPage )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// save the old playlist shuffle state in config before we change playlists
|
|
||||||
saveCurrentPlaylistSettings();
|
|
||||||
unlinkPlaylist();
|
unlinkPlaylist();
|
||||||
|
|
||||||
if ( m_stack->indexOf( page->widget() ) < 0 )
|
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
|
void
|
||||||
ViewManager::updateView()
|
ViewManager::updateView()
|
||||||
{
|
{
|
||||||
@@ -672,31 +646,6 @@ ViewManager::updateView()
|
|||||||
}
|
}
|
||||||
m_infobar->setLongDescription( currentPage()->longDescription() );
|
m_infobar->setLongDescription( currentPage()->longDescription() );
|
||||||
m_infobar->setPixmap( currentPage()->pixmap() );
|
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() ));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -175,8 +175,6 @@ private:
|
|||||||
void setPage( Tomahawk::ViewPage* page, bool trackHistory = true );
|
void setPage( Tomahawk::ViewPage* page, bool trackHistory = true );
|
||||||
void updateView();
|
void updateView();
|
||||||
void unlinkPlaylist();
|
void unlinkPlaylist();
|
||||||
void saveCurrentPlaylistSettings();
|
|
||||||
void loadCurrentPlaylistSettings();
|
|
||||||
|
|
||||||
Tomahawk::playlist_ptr playlistForInterface( Tomahawk::playlistinterface_ptr plInterface ) const;
|
Tomahawk::playlist_ptr playlistForInterface( Tomahawk::playlistinterface_ptr plInterface ) const;
|
||||||
Tomahawk::dynplaylist_ptr dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr plInterface ) const;
|
Tomahawk::dynplaylist_ptr dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr plInterface ) const;
|
||||||
|
Reference in New Issue
Block a user