mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-11 00:24:12 +02:00
Style fix, constants
This commit is contained in:
@@ -224,7 +224,7 @@ ChartsPlugin::fetchChartCapabilitiesFromCache( Tomahawk::InfoSystem::InfoRequest
|
|||||||
}
|
}
|
||||||
|
|
||||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Checking cache for " << "InfoChartCapabilities" << m_chartVersion;
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Checking cache for " << "InfoChartCapabilities" << m_chartVersion;
|
||||||
emit getCachedInfo ( criteria, 172800000 /* 2 days */, requestData );
|
emit getCachedInfo( criteria, 172800000 /* 2 days */, requestData );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -377,7 +377,7 @@ ChartsPlugin::fetchChart( Tomahawk::InfoSystem::InfoRequestData requestData, con
|
|||||||
QNetworkReply* reply = TomahawkUtils::nam()->get( QNetworkRequest( url ) );
|
QNetworkReply* reply = TomahawkUtils::nam()->get( QNetworkRequest( url ) );
|
||||||
reply->setProperty( "requestData", QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
|
reply->setProperty( "requestData", QVariant::fromValue< Tomahawk::InfoSystem::InfoRequestData >( requestData ) );
|
||||||
|
|
||||||
connect ( reply, SIGNAL( finished() ), SLOT( chartReturned() ) );
|
connect( reply, SIGNAL( finished() ), SLOT( chartReturned() ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -404,11 +404,13 @@ ChartsPlugin::chartsList()
|
|||||||
const QString source = reply->property("chart_source").toString();
|
const QString source = reply->property("chart_source").toString();
|
||||||
const qlonglong expires = QString( reply->rawHeader( QString( "Expires" ).toLocal8Bit() ) ).toLongLong( &ok );
|
const qlonglong expires = QString( reply->rawHeader( QString( "Expires" ).toLocal8Bit() ) ).toLongLong( &ok );
|
||||||
|
|
||||||
if( !ok )
|
if ( !ok )
|
||||||
{
|
{
|
||||||
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Failed to parse expire headers!";
|
||||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << reply->url();
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << reply->url();
|
||||||
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << reply->rawHeaderPairs();
|
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << reply->rawHeaderPairs();
|
||||||
}
|
}
|
||||||
|
|
||||||
// We'll populate charts with the data from the server
|
// We'll populate charts with the data from the server
|
||||||
QVariantMap charts;
|
QVariantMap charts;
|
||||||
QString chartName;
|
QString chartName;
|
||||||
@@ -433,7 +435,7 @@ ChartsPlugin::chartsList()
|
|||||||
const QString geo = chart.value( "geo" ).toString();
|
const QString geo = chart.value( "geo" ).toString();
|
||||||
QString name = chart.value( "genre" ).toString();
|
QString name = chart.value( "genre" ).toString();
|
||||||
const QString type = QString( chart.value( "type" ).toString() + "s" );
|
const QString type = QString( chart.value( "type" ).toString() + "s" );
|
||||||
bool isDefault = ( chart.contains( "default" ) && chart[ "default" ].toInt() == 1 );
|
const bool isDefault = ( chart.contains( "default" ) && chart[ "default" ].toInt() == 1 );
|
||||||
|
|
||||||
// Hack!
|
// Hack!
|
||||||
// Japan charts contains multiple duplicates, all which are linked
|
// Japan charts contains multiple duplicates, all which are linked
|
||||||
@@ -477,9 +479,7 @@ ChartsPlugin::chartsList()
|
|||||||
c[ "label" ] = name;
|
c[ "label" ] = name;
|
||||||
c[ "type" ] = "album";
|
c[ "type" ] = "album";
|
||||||
if ( isDefault )
|
if ( isDefault )
|
||||||
{
|
|
||||||
c[ "default" ] = "true";
|
c[ "default" ] = "true";
|
||||||
}
|
|
||||||
|
|
||||||
/// If this item has expired, set it to 0.
|
/// If this item has expired, set it to 0.
|
||||||
c[ "expires" ] = ( ok ? QString::number (expires ) : QString::number( 0 ) );
|
c[ "expires" ] = ( ok ? QString::number (expires ) : QString::number( 0 ) );
|
||||||
|
Reference in New Issue
Block a user