From fcc857a7349e1756f13a481d42359f2cde61e293 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Tue, 28 Jan 2014 22:39:27 +0000 Subject: [PATCH] Allow multiple arguments in API 1.5 call --- src/libtomahawk-playdarapi/Api_v1.cpp | 28 +++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/libtomahawk-playdarapi/Api_v1.cpp b/src/libtomahawk-playdarapi/Api_v1.cpp index dea66983b..8871daa90 100644 --- a/src/libtomahawk-playdarapi/Api_v1.cpp +++ b/src/libtomahawk-playdarapi/Api_v1.cpp @@ -190,9 +190,33 @@ Api_v1::api( QxtWebRequestEvent* event, const QString& version, const QString& m } else if ( version == "1.5" ) { - if ( !QMetaObject::invokeMethod( m_api_v1_5, method.toLatin1().constData(), Q_ARG( QxtWebRequestEvent*, event ) ) ) + if ( !arg3.isEmpty() ) { - apiCallFailed(event, method); + 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 ) ) ) + { + apiCallFailed(event, method); + } } } else