mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
* Fixed TWK-1096: Deleting a playlist destroys the current view.
This commit is contained in:
@@ -144,6 +144,8 @@ FlexibleView::setDetailedView( TrackView* view )
|
|||||||
delete m_detailedView;
|
delete m_detailedView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect( view, SIGNAL( destroyed( QWidget* ) ), SLOT( onWidgetDestroyed( QWidget* ) ), Qt::UniqueConnection );
|
||||||
|
|
||||||
view->setPlaylistInterface( m_playlistInterface );
|
view->setPlaylistInterface( m_playlistInterface );
|
||||||
|
|
||||||
m_detailedView = view;
|
m_detailedView = view;
|
||||||
@@ -289,4 +291,12 @@ FlexibleView::setPixmap( const QPixmap& pixmap )
|
|||||||
m_header->setPixmap( pixmap );
|
m_header->setPixmap( pixmap );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
FlexibleView::onWidgetDestroyed( QWidget* widget )
|
||||||
|
{
|
||||||
|
emit destroyed( this );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "FlexibleView.moc"
|
#include "FlexibleView.moc"
|
||||||
|
@@ -72,8 +72,10 @@ public slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void modeChanged( FlexibleViewMode mode );
|
void modeChanged( FlexibleViewMode mode );
|
||||||
|
void destroyed( QWidget* widget );
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
void onWidgetDestroyed( QWidget* widget );
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FlexibleHeader* m_header;
|
FlexibleHeader* m_header;
|
||||||
|
@@ -73,9 +73,6 @@ void
|
|||||||
PlaylistView::keyPressEvent( QKeyEvent* event )
|
PlaylistView::keyPressEvent( QKeyEvent* event )
|
||||||
{
|
{
|
||||||
TrackView::keyPressEvent( event );
|
TrackView::keyPressEvent( event );
|
||||||
|
|
||||||
if ( !model() )
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -124,7 +121,6 @@ PlaylistView::updaters() const
|
|||||||
void
|
void
|
||||||
PlaylistView::onDeleted()
|
PlaylistView::onDeleted()
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
|
||||||
emit destroyed( widget() );
|
emit destroyed( widget() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user