diff --git a/src/libtomahawk/jobview/JobStatusModel.cpp b/src/libtomahawk/jobview/JobStatusModel.cpp index 28e1ce36c..08df1b614 100644 --- a/src/libtomahawk/jobview/JobStatusModel.cpp +++ b/src/libtomahawk/jobview/JobStatusModel.cpp @@ -187,6 +187,7 @@ JobStatusModel::itemFinished() // One less to count, but item is still there const QModelIndex idx = index( indexOf, 0, QModelIndex() ); emit dataChanged( idx, idx ); + emit refreshDelegates(); return; } } @@ -203,6 +204,7 @@ JobStatusModel::itemFinished() if ( item->customDelegate() ) emit customDelegateJobRemoved( idx ); + emit refreshDelegates(); tLog() << Q_FUNC_INFO << "current jobs of item type: " << m_jobTypeCount[ item->type() ] << ", current queue size of item type: " << m_jobQueue[ item->type() ].size(); if ( item->concurrentJobLimit() > 0 ) diff --git a/src/libtomahawk/jobview/JobStatusModel.h b/src/libtomahawk/jobview/JobStatusModel.h index ff4d19b83..7db63267f 100644 --- a/src/libtomahawk/jobview/JobStatusModel.h +++ b/src/libtomahawk/jobview/JobStatusModel.h @@ -49,6 +49,7 @@ public: signals: void customDelegateJobInserted( int row, JobStatusItem* item ); void customDelegateJobRemoved( int row ); + void refreshDelegates(); public slots: /// Takes ownership of job diff --git a/src/libtomahawk/jobview/JobStatusView.cpp b/src/libtomahawk/jobview/JobStatusView.cpp index 393b47ba3..8b29013fe 100644 --- a/src/libtomahawk/jobview/JobStatusView.cpp +++ b/src/libtomahawk/jobview/JobStatusView.cpp @@ -94,6 +94,7 @@ JobStatusView::setModel( JobStatusModel* m ) connect( m_view->model(), SIGNAL( modelReset() ), this, SLOT( checkCount() ) ); connect( m_view->model(), SIGNAL( customDelegateJobInserted( int, JobStatusItem* ) ), this, SLOT( customDelegateJobInserted( int, JobStatusItem* ) ) ); connect( m_view->model(), SIGNAL( customDelegateJobRemoved( int ) ), this, SLOT( customDelegateJobRemoved( int ) ) ); + connect( m_view->model(), SIGNAL( refreshDelegates() ), this, SLOT( refreshDelegates() ) ); } @@ -127,6 +128,13 @@ void JobStatusView::customDelegateJobRemoved( int row ) { tLog() << Q_FUNC_INFO << "row is " << row; +} + + +void +JobStatusView::refreshDelegates() +{ + tLog() << Q_FUNC_INFO; int count = m_model->rowCount(); for ( int i = 0; i < count; i++ ) { diff --git a/src/libtomahawk/jobview/JobStatusView.h b/src/libtomahawk/jobview/JobStatusView.h index 1a5edf665..c845815de 100644 --- a/src/libtomahawk/jobview/JobStatusView.h +++ b/src/libtomahawk/jobview/JobStatusView.h @@ -55,6 +55,7 @@ private slots: void checkCount(); void customDelegateJobInserted( int row, JobStatusItem* item ); void customDelegateJobRemoved( int row ); + void refreshDelegates(); private: QListView* m_view;