mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-05 13:47:26 +02:00
Allow multiple arguments in API 1.5 call
This commit is contained in:
@@ -189,12 +189,36 @@ Api_v1::api( QxtWebRequestEvent* event, const QString& version, const QString& m
|
|||||||
send404( event );
|
send404( event );
|
||||||
}
|
}
|
||||||
else if ( version == "1.5" )
|
else if ( version == "1.5" )
|
||||||
|
{
|
||||||
|
if ( !arg3.isEmpty() )
|
||||||
|
{
|
||||||
|
if ( !QMetaObject::invokeMethod( m_api_v1_5, method.toLatin1().constData(), Q_ARG( QxtWebRequestEvent*, event ), Q_ARG( QString, arg1 ), Q_ARG( QString, arg2 ), Q_ARG( QString, arg3 ) ) )
|
||||||
|
{
|
||||||
|
apiCallFailed(event, method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( !arg2.isEmpty() )
|
||||||
|
{
|
||||||
|
if ( !QMetaObject::invokeMethod( m_api_v1_5, method.toLatin1().constData(), Q_ARG( QxtWebRequestEvent*, event ), Q_ARG( QString, arg1 ), Q_ARG( QString, arg2 ) ) )
|
||||||
|
{
|
||||||
|
apiCallFailed(event, method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ( !arg1.isEmpty() )
|
||||||
|
{
|
||||||
|
if ( !QMetaObject::invokeMethod( m_api_v1_5, method.toLatin1().constData(), Q_ARG( QxtWebRequestEvent*, event ), Q_ARG( QString, arg1 ) ) )
|
||||||
|
{
|
||||||
|
apiCallFailed(event, method);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if ( !QMetaObject::invokeMethod( m_api_v1_5, method.toLatin1().constData(), Q_ARG( QxtWebRequestEvent*, event ) ) )
|
if ( !QMetaObject::invokeMethod( m_api_v1_5, method.toLatin1().constData(), Q_ARG( QxtWebRequestEvent*, event ) ) )
|
||||||
{
|
{
|
||||||
apiCallFailed(event, method);
|
apiCallFailed(event, method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sendPlain404( event, QString( "Unknown API version %1" ).arg( version ), "API version not found" );
|
sendPlain404( event, QString( "Unknown API version %1" ).arg( version ), "API version not found" );
|
||||||
|
Reference in New Issue
Block a user