1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-21 16:29:43 +01:00

* Don't tell model about item size if there's no model yet.

This commit is contained in:
Christian Muehlhaeuser 2012-05-23 16:54:50 +02:00
parent bc0e3810d7
commit ab602b2072

View File

@ -195,7 +195,7 @@ AlbumView::resizeEvent( QResizeEvent* event )
{
QListView::resizeEvent( event );
if ( autoFitItems() )
if ( autoFitItems() && m_model )
{
#ifdef Q_WS_X11
// int scrollbar = verticalScrollBar()->isVisible() ? verticalScrollBar()->width() + 16 : 0;
@ -215,6 +215,7 @@ AlbumView::resizeEvent( QResizeEvent* event )
int remSpace = rectWidth - ( itemsPerRow * itemWidth );
int extraSpace = remSpace / itemsPerRow;
int newItemWidth = itemWidth + extraSpace;
m_model->setItemSize( QSize( newItemWidth, newItemWidth ) );
if ( !m_inited )