mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-12 09:04:33 +02:00
Don't crash if there's no model attached to a view when it's resized
This commit is contained in:
@@ -196,6 +196,9 @@ ArtistView::resizeEvent( QResizeEvent* event )
|
|||||||
QTreeView::resizeEvent( event );
|
QTreeView::resizeEvent( event );
|
||||||
m_header->checkState();
|
m_header->checkState();
|
||||||
|
|
||||||
|
if ( !model() )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( model()->columnCount( QModelIndex() ) == 1 )
|
if ( model()->columnCount( QModelIndex() ) == 1 )
|
||||||
{
|
{
|
||||||
m_header->resizeSection( 0, event->size().width() );
|
m_header->resizeSection( 0, event->size().width() );
|
||||||
|
@@ -233,6 +233,9 @@ TrackView::resizeEvent( QResizeEvent* event )
|
|||||||
sortByColumn( sortSection, sortOrder );
|
sortByColumn( sortSection, sortOrder );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( !model() )
|
||||||
|
return;
|
||||||
|
|
||||||
if ( model()->columnCount() == 1 )
|
if ( model()->columnCount() == 1 )
|
||||||
{
|
{
|
||||||
m_header->resizeSection( 0, event->size().width() );
|
m_header->resizeSection( 0, event->size().width() );
|
||||||
|
Reference in New Issue
Block a user