mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
Style fix and timeout fix
This commit is contained in:
@@ -110,13 +110,19 @@ ChartsPlugin::getInfo( uint requestId, Tomahawk::InfoSystem::InfoRequestData req
|
||||
{
|
||||
dataError( requestId, requestData );
|
||||
break;
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach( QVariant resource, m_chartResources )
|
||||
{
|
||||
if( resource.toString() == hash["chart_source"] )
|
||||
{
|
||||
foundSource = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(!foundSource){
|
||||
if( !foundSource )
|
||||
{
|
||||
dataError( requestId, requestData );
|
||||
break;
|
||||
}
|
||||
|
@@ -398,7 +398,7 @@ LastFmPlugin::notInCacheSlot( uint requestId, QHash<QString, QString> criteria,
|
||||
emit info( requestId, requestData, QVariant() );
|
||||
return;
|
||||
}
|
||||
bool foundSource;
|
||||
|
||||
InfoCriteriaHash hash = requestData.input.value< Tomahawk::InfoSystem::InfoCriteriaHash >();
|
||||
switch ( requestData.type )
|
||||
{
|
||||
@@ -409,9 +409,11 @@ LastFmPlugin::notInCacheSlot( uint requestId, QHash<QString, QString> criteria,
|
||||
{
|
||||
dataError( requestId, requestData );
|
||||
break;
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
if( "last.fm" != hash["chart_source"] )
|
||||
{
|
||||
if("last.fm" != hash["chart_source"]){
|
||||
dataError( requestId, requestData );
|
||||
break;
|
||||
}
|
||||
|
@@ -121,7 +121,7 @@ WhatsHotWidget::WhatsHotWidget( QWidget* parent )
|
||||
|
||||
connect( Tomahawk::InfoSystem::InfoSystem::instance(), SIGNAL( finished( QString ) ), SLOT( infoSystemFinished( QString ) ) );
|
||||
|
||||
QTimer::singleShot( 2000, this, SLOT( fetchData() ) );
|
||||
QTimer::singleShot( 0, this, SLOT( fetchData() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ WhatsHotWidget::fetchData()
|
||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( artistInfo );
|
||||
|
||||
requestData.type = Tomahawk::InfoSystem::InfoChartCapabilities;
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData, 2000, true );
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData, 20000, true );
|
||||
|
||||
tDebug( LOGVERBOSE ) << "WhatsHot: requested InfoChartCapabilities";
|
||||
}
|
||||
@@ -299,7 +299,7 @@ WhatsHotWidget::leftCrumbIndexChanged( QModelIndex index )
|
||||
requestData.input = QVariant::fromValue< Tomahawk::InfoSystem::InfoCriteriaHash >( criteria );
|
||||
|
||||
requestData.type = Tomahawk::InfoSystem::InfoChart;
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData, 2000, true );
|
||||
Tomahawk::InfoSystem::InfoSystem::instance()->getInfo( requestData, 20000, true );
|
||||
}
|
||||
|
||||
|
||||
@@ -326,6 +326,7 @@ WhatsHotWidget::parseNode(QStandardItem* parentItem, const QString &label, const
|
||||
tDebug( LOGVERBOSE ) << "WhatsHot:: parsing " << label;
|
||||
|
||||
QStandardItem *sourceItem = new QStandardItem(label);
|
||||
|
||||
if( data.canConvert<QList<Tomahawk::InfoSystem::Chart> >() )
|
||||
{
|
||||
QList<Tomahawk::InfoSystem::Chart> charts = data.value<QList<Tomahawk::InfoSystem::Chart> >();
|
||||
@@ -335,7 +336,8 @@ WhatsHotWidget::parseNode(QStandardItem* parentItem, const QString &label, const
|
||||
childItem->setData( chart.id );
|
||||
sourceItem->appendRow( childItem );
|
||||
}
|
||||
} else if( data.canConvert<QVariantMap>() )
|
||||
}
|
||||
else if( data.canConvert<QVariantMap>() )
|
||||
{
|
||||
QVariantMap dataMap = data.toMap();
|
||||
foreach( const QString childLabel,dataMap.keys() )
|
||||
@@ -343,7 +345,8 @@ WhatsHotWidget::parseNode(QStandardItem* parentItem, const QString &label, const
|
||||
QStandardItem *childItem = parseNode( sourceItem, childLabel, dataMap[childLabel] );
|
||||
sourceItem->appendRow( childItem );
|
||||
}
|
||||
} else if ( data.canConvert<QVariantList>() )
|
||||
}
|
||||
else if ( data.canConvert<QVariantList>() )
|
||||
{
|
||||
QVariantList dataList = data.toList();
|
||||
|
||||
|
Reference in New Issue
Block a user