diff --git a/src/libtomahawk/playlist/PlaylistChartItemDelegate.cpp b/src/libtomahawk/playlist/PlaylistChartItemDelegate.cpp index 49c9cc7b9..eba7c3b97 100644 --- a/src/libtomahawk/playlist/PlaylistChartItemDelegate.cpp +++ b/src/libtomahawk/playlist/PlaylistChartItemDelegate.cpp @@ -59,10 +59,11 @@ PlaylistChartItemDelegate::PlaylistChartItemDelegate( TrackView* parent, Playabl m_bottomOption = QTextOption( Qt::AlignBottom ); m_bottomOption.setWrapMode( QTextOption::NoWrap ); + connect( this, SIGNAL( updateIndex( QModelIndex ) ), parent, SLOT( update( QModelIndex ) ) ); + connect( m_model, SIGNAL( modelReset() ), this, SLOT( modelChanged() ) ); if ( PlaylistView* plView = qobject_cast< PlaylistView* >( parent ) ) connect( plView, SIGNAL( modelChanged() ), this, SLOT( modelChanged() ) ); - } @@ -91,11 +92,8 @@ PlaylistChartItemDelegate::sizeHint( const QStyleOptionViewItem& option, const Q stretch = 2; } - if ( index.isValid() ) - { - int rowHeight = option.fontMetrics.height() + 8; - size.setHeight( rowHeight * stretch ); - } + int rowHeight = option.fontMetrics.height() + 8; + size.setHeight( rowHeight * stretch ); return size; } @@ -241,7 +239,7 @@ PlaylistChartItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& void PlaylistChartItemDelegate::doUpdateIndex( const QPersistentModelIndex& idx ) { - emit updateRequest( idx ); + emit updateIndex( idx ); } diff --git a/src/libtomahawk/playlist/PlaylistChartItemDelegate.h b/src/libtomahawk/playlist/PlaylistChartItemDelegate.h index 87017d453..ffa642bd6 100644 --- a/src/libtomahawk/playlist/PlaylistChartItemDelegate.h +++ b/src/libtomahawk/playlist/PlaylistChartItemDelegate.h @@ -43,7 +43,7 @@ public: PlaylistChartItemDelegate( TrackView* parent = 0, PlayableProxyModel* proxy = 0 ); signals: - void updateRequest( const QModelIndex& idx ); + void updateIndex( const QModelIndex& idx ); protected: void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;