diff --git a/src/libtomahawk/jobview/JobStatusModel.cpp b/src/libtomahawk/jobview/JobStatusModel.cpp index 3b022bae8..2bd8890c5 100644 --- a/src/libtomahawk/jobview/JobStatusModel.cpp +++ b/src/libtomahawk/jobview/JobStatusModel.cpp @@ -101,25 +101,32 @@ JobStatusModel::data( const QModelIndex& index, int role ) const switch ( role ) { - case Qt::DecorationRole: - return item->icon(); - case Qt::ToolTipRole: - case Qt::DisplayRole: - { - if ( m_collapseCount.contains( item->type() ) ) - return m_collapseCount[ item->type() ].last()->mainText(); - else - return item->mainText(); - } - case RightColumnRole: - { - if ( m_collapseCount.contains( item->type() ) ) - return m_collapseCount[ item->type() ].count(); - else - return item->rightColumnText(); - } - case AllowMultiLineRole: - return item->allowMultiLine(); + case Qt::DecorationRole: + return item->icon(); + + case Qt::ToolTipRole: + + case Qt::DisplayRole: + { + if ( m_collapseCount.contains( item->type() ) ) + return m_collapseCount[ item->type() ].last()->mainText(); + else + return item->mainText(); + } + + case RightColumnRole: + { + if ( m_collapseCount.contains( item->type() ) ) + return m_collapseCount[ item->type() ].count(); + else + return item->rightColumnText(); + } + + case AllowMultiLineRole: + return item->allowMultiLine(); + + case JobDataRole: + return QVariant::fromValue< JobStatusItem* >( item ); } return QVariant(); diff --git a/src/libtomahawk/jobview/JobStatusModel.h b/src/libtomahawk/jobview/JobStatusModel.h index 0008f82e2..a03f530e1 100644 --- a/src/libtomahawk/jobview/JobStatusModel.h +++ b/src/libtomahawk/jobview/JobStatusModel.h @@ -35,7 +35,8 @@ public: // DecorationRole is icon // DisplayRole is main col RightColumnRole = Qt::UserRole + 1, - AllowMultiLineRole = Qt::UserRole + 2 + AllowMultiLineRole = Qt::UserRole + 2, + JobDataRole = Qt::UserRole + 3 }; explicit JobStatusModel( QObject* parent = 0 ); diff --git a/src/tomahawkapp.cpp b/src/tomahawkapp.cpp index ec729071a..33ca53f5c 100644 --- a/src/tomahawkapp.cpp +++ b/src/tomahawkapp.cpp @@ -409,6 +409,7 @@ TomahawkApp::registerMetaTypes() qRegisterMetaType< QHash< QString, QMap > >("QHash< QString, QMap >"); qRegisterMetaType< QMap< QString, QMap< unsigned int, unsigned int > > >("QMap< QString, QMap< unsigned int, unsigned int > >"); qRegisterMetaType< PairList >("PairList"); + qRegisterMetaType< JobStatusItem* >("JobStatusItem*"); qRegisterMetaType< GeneratorMode>("GeneratorMode"); qRegisterMetaType("Tomahawk::GeneratorMode");