mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Doing so for now. Need to create ui for specific albums
This commit is contained in:
@@ -265,7 +265,7 @@ ChartsPlugin::chartResources()
|
|||||||
foreach(QVariant resource, m_chartResources){
|
foreach(QVariant resource, m_chartResources){
|
||||||
tDebug() << "ChartsPlugin: InfoChart fetching possible types for "<< resource.toString();
|
tDebug() << "ChartsPlugin: InfoChart fetching possible types for "<< resource.toString();
|
||||||
|
|
||||||
QUrl url = QUrl( QString( CHART_URL "/source/%1" ).arg(resource.toString() ) );
|
QUrl url = QUrl( QString( CHART_URL "source/%1" ).arg(resource.toString() ) );
|
||||||
qDebug() << "Getting types from " << url;
|
qDebug() << "Getting types from " << url;
|
||||||
|
|
||||||
QNetworkReply* reply = lastfm::nam()->get( QNetworkRequest( url ) );
|
QNetworkReply* reply = lastfm::nam()->get( QNetworkRequest( url ) );
|
||||||
@@ -298,8 +298,10 @@ ChartsPlugin::chartTypes()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(QVariant chart, res.value( "charts" ).toMap() )
|
foreach(QVariant chart, res.value( "charts" ).toMap() ){
|
||||||
m_chartTypes.append(chart);
|
m_chartTypes.append(chart);
|
||||||
|
qDebug() << "Chart types" << chart;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -78,8 +78,11 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
|
|||||||
ui->breadCrumbRight->setModel(m_crumbModelLeft);
|
ui->breadCrumbRight->setModel(m_crumbModelLeft);
|
||||||
ui->breadCrumbRight->setUseAnimation(true);*/
|
ui->breadCrumbRight->setUseAnimation(true);*/
|
||||||
|
|
||||||
m_tracksModel = new PlaylistModel( ui->tracksViewLeft );
|
|
||||||
m_tracksModel->setStyle( TrackModel::Short );
|
m_tracksModel = new TreeModel( ui->tracksViewLeft );
|
||||||
|
ui->tracksViewLeft->setTreeModel( m_tracksModel );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ui->tracksViewLeft->setFrameShape( QFrame::NoFrame );
|
ui->tracksViewLeft->setFrameShape( QFrame::NoFrame );
|
||||||
ui->tracksViewLeft->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
ui->tracksViewLeft->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
@@ -207,17 +210,20 @@ WhatsHotWidget::infoSystemInfo( Tomahawk::InfoSystem::InfoRequestData requestDat
|
|||||||
}
|
}
|
||||||
else if( type == "albums" )
|
else if( type == "albums" )
|
||||||
{
|
{
|
||||||
|
setLeftViewArtists();
|
||||||
setLeftViewTracks();
|
m_artistsModel->clear();
|
||||||
m_tracksModel->clear();
|
|
||||||
|
|
||||||
const QList<Tomahawk::InfoSystem::ArtistAlbumPair> albums = returnedData["albums"].value<QList<Tomahawk::InfoSystem::ArtistAlbumPair> >();
|
const QList<Tomahawk::InfoSystem::ArtistAlbumPair> albums = returnedData["albums"].value<QList<Tomahawk::InfoSystem::ArtistAlbumPair> >();
|
||||||
tDebug( LOGVERBOSE ) << "WhatsHot: got albums! " << albums.size();
|
tDebug( LOGVERBOSE ) << "WhatsHot: got albums! " << albums.size();
|
||||||
|
|
||||||
foreach ( const Tomahawk::InfoSystem::ArtistAlbumPair& album, albums )
|
foreach ( const Tomahawk::InfoSystem::ArtistAlbumPair& album, albums )
|
||||||
{
|
{
|
||||||
query_ptr query = Query::get( album.artist, QString(), album.album, uuid() );
|
//query_ptr query = Query::get( album.artist, QString(), album.album, uuid() );
|
||||||
m_tracksModel->append( query );
|
artist_ptr artistPtr = Artist::get( album.artist );
|
||||||
|
//album_ptr albumPtr = Album::get( 0, album.album, artistPtr );
|
||||||
|
|
||||||
|
m_artistsModel->addArtists( artistPtr );
|
||||||
|
//m_albumsModel->append( query );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( type == "tracks" )
|
else if( type == "tracks" )
|
||||||
@@ -255,9 +261,7 @@ WhatsHotWidget::infoSystemFinished( QString target )
|
|||||||
void
|
void
|
||||||
WhatsHotWidget::leftCrumbIndexChanged( QModelIndex index )
|
WhatsHotWidget::leftCrumbIndexChanged( QModelIndex index )
|
||||||
{
|
{
|
||||||
|
tDebug( LOGVERBOSE ) << "WhatsHot:: left crumb changed" << index.data();
|
||||||
|
|
||||||
tDebug( LOGVERBOSE ) << "WhatsHot:: left crumb current changed" << index.data();
|
|
||||||
QStandardItem* item = m_crumbModelLeft->itemFromIndex(index);
|
QStandardItem* item = m_crumbModelLeft->itemFromIndex(index);
|
||||||
if( !item )
|
if( !item )
|
||||||
return;
|
return;
|
||||||
@@ -265,7 +269,6 @@ WhatsHotWidget::leftCrumbIndexChanged( QModelIndex index )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
// Get the base eg. source identifier
|
|
||||||
QList<QModelIndex> indexes;
|
QList<QModelIndex> indexes;
|
||||||
while (index.parent().isValid())
|
while (index.parent().isValid())
|
||||||
{
|
{
|
||||||
@@ -288,9 +291,6 @@ WhatsHotWidget::leftCrumbIndexChanged( QModelIndex index )
|
|||||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( criteria );
|
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( criteria );
|
||||||
|
|
||||||
requestData.type = Tomahawk::InfoSystem::InfoChart;
|
requestData.type = Tomahawk::InfoSystem::InfoChart;
|
||||||
qDebug() << Q_FUNC_INFO << "RequestData custom" << requestData.customData;
|
|
||||||
qDebug() << Q_FUNC_INFO << "RequestData caller" << requestData.caller;
|
|
||||||
qDebug() << Q_FUNC_INFO << "RequestData input" << requestData.input;
|
|
||||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
|
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,30 +30,6 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="page3">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<widget class="QListView" name="albumViewLeft">
|
|
||||||
<property name="enabled">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>9</x>
|
|
||||||
<y>9</y>
|
|
||||||
<width>839</width>
|
|
||||||
<height>471</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>320</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="page1">
|
<widget class="QWidget" name="page1">
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<item>
|
<item>
|
||||||
@@ -81,7 +57,7 @@
|
|||||||
<customwidget>
|
<customwidget>
|
||||||
<class>ArtistView</class>
|
<class>ArtistView</class>
|
||||||
<extends>QTreeView</extends>
|
<extends>QTreeView</extends>
|
||||||
<header>artistview.h</header>
|
<header location="global">artistview.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>HeaderBreadCrumb</class>
|
<class>HeaderBreadCrumb</class>
|
||||||
|
Reference in New Issue
Block a user