mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-14 01:54:07 +02:00
* Properly store / restore DynamicQmlWidgets.
This commit is contained in:
@@ -190,14 +190,9 @@ ViewManager::show( const Tomahawk::playlist_ptr& playlist )
|
||||
Tomahawk::ViewPage*
|
||||
ViewManager::show( const Tomahawk::dynplaylist_ptr& playlist )
|
||||
{
|
||||
DynamicQmlWidget* w = new Tomahawk::DynamicQmlWidget( playlist, m_stack );
|
||||
setPage( w );
|
||||
return w;
|
||||
|
||||
//// OLD FOO
|
||||
if ( !m_dynamicWidgets.contains( playlist ) || m_dynamicWidgets.value( playlist ).isNull() )
|
||||
{
|
||||
m_dynamicWidgets[ playlist ] = new Tomahawk::DynamicWidget( playlist, m_stack );
|
||||
m_dynamicWidgets[ playlist ] = new Tomahawk::DynamicQmlWidget( playlist, m_stack );
|
||||
|
||||
playlist->resolve();
|
||||
}
|
||||
@@ -855,7 +850,7 @@ ViewManager::playlistForInterface( Tomahawk::playlistinterface_ptr interface ) c
|
||||
Tomahawk::dynplaylist_ptr
|
||||
ViewManager::dynamicPlaylistForInterface( Tomahawk::playlistinterface_ptr interface ) const
|
||||
{
|
||||
foreach ( QWeakPointer<DynamicWidget> view, m_dynamicWidgets.values() )
|
||||
foreach ( QWeakPointer<DynamicQmlWidget> view, m_dynamicWidgets.values() )
|
||||
{
|
||||
if ( !view.isNull() && view.data()->playlistInterface() == interface )
|
||||
{
|
||||
|
@@ -59,6 +59,7 @@ class QPushButton;
|
||||
namespace Tomahawk
|
||||
{
|
||||
class DynamicWidget;
|
||||
class DynamicQmlWidget;
|
||||
}
|
||||
|
||||
class DLLEXPORT ViewManager : public QObject
|
||||
@@ -199,7 +200,7 @@ private:
|
||||
|
||||
QList< Tomahawk::collection_ptr > m_superCollections;
|
||||
|
||||
QHash< Tomahawk::dynplaylist_ptr, QWeakPointer<Tomahawk::DynamicWidget> > m_dynamicWidgets;
|
||||
QHash< Tomahawk::dynplaylist_ptr, QWeakPointer<Tomahawk::DynamicQmlWidget> > m_dynamicWidgets;
|
||||
QHash< Tomahawk::collection_ptr, QWeakPointer<TreeView> > m_treeViews;
|
||||
QHash< Tomahawk::artist_ptr, QWeakPointer<ArtistInfoWidget> > m_artistViews;
|
||||
QHash< Tomahawk::album_ptr, QWeakPointer<AlbumInfoWidget> > m_albumViews;
|
||||
|
Reference in New Issue
Block a user