diff --git a/src/libtomahawk/widgets/Breadcrumb.h b/src/libtomahawk/widgets/Breadcrumb.h index ecc2279b2..74adabf1a 100644 --- a/src/libtomahawk/widgets/Breadcrumb.h +++ b/src/libtomahawk/widgets/Breadcrumb.h @@ -45,7 +45,8 @@ class Breadcrumb : public QWidget public: enum ExtraRoles { DefaultRole = Qt::UserRole + 1, - UserSelectedRole = Qt::UserRole + 2 + UserSelectedRole = Qt::UserRole + 2, + ChartIdRole = Qt::UserRole + 3 }; explicit Breadcrumb( QWidget* parent = 0, Qt::WindowFlags f = 0 ); diff --git a/src/libtomahawk/widgets/BreadcrumbButton.cpp b/src/libtomahawk/widgets/BreadcrumbButton.cpp index 17b591c51..3c005732d 100644 --- a/src/libtomahawk/widgets/BreadcrumbButton.cpp +++ b/src/libtomahawk/widgets/BreadcrumbButton.cpp @@ -92,7 +92,7 @@ QSize BreadcrumbButton::sizeHint() const { // our width = width of combo + 20px for right-arrow and spacing - const int padding = hasChildren() ? 20 : 5; + const int padding = hasChildren() ? 20 : 8; return m_combo->sizeHint() + QSize( padding, 0 ); } diff --git a/src/libtomahawk/widgets/whatshotwidget.cpp b/src/libtomahawk/widgets/whatshotwidget.cpp index 0f8dbd00d..f46d488b7 100644 --- a/src/libtomahawk/widgets/whatshotwidget.cpp +++ b/src/libtomahawk/widgets/whatshotwidget.cpp @@ -308,19 +308,19 @@ WhatsHotWidget::leftCrumbIndexChanged( QModelIndex index ) QStandardItem* item = m_crumbModelLeft->itemFromIndex( index ); if( !item ) return; - if( !item->data().isValid() ) + if( !item->data( Breadcrumb::ChartIdRole ).isValid() ) return; - QList indexes; - while ( index.parent().isValid() ) - { - indexes.prepend(index); - index = index.parent(); - } + QList indexes; + while ( index.parent().isValid() ) + { + indexes.prepend(index); + index = index.parent(); + } - const QString chartId = item->data().toString(); + const QString chartId = item->data( Breadcrumb::ChartIdRole ).toString(); if ( m_artistModels.contains( chartId ) ) { @@ -394,9 +394,11 @@ WhatsHotWidget::parseNode( QStandardItem* parentItem, const QString &label, cons foreach ( Tomahawk::InfoSystem::InfoStringHash chart, charts ) { QStandardItem *childItem= new QStandardItem( chart[ "label" ] ); - childItem->setData( chart[ "id" ] ); + childItem->setData( chart[ "id" ], Breadcrumb::ChartIdRole ); if ( chart.value( "default", "" ) == "true") - sourceItem->setData( Breadcrumb::DefaultRole, true ); + { + childItem->setData( true, Breadcrumb::DefaultRole ); + } sourceItem->appendRow( childItem ); } }