From 5e5183fc18ac5b68bf62cb809199fc7adc8b3afd Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Mon, 30 Jun 2014 17:56:58 +0100 Subject: [PATCH] Expose accountId to JavaScript --- src/libtomahawk/resolvers/JSResolverHelper.cpp | 7 +++++++ src/libtomahawk/resolvers/JSResolverHelper.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/libtomahawk/resolvers/JSResolverHelper.cpp b/src/libtomahawk/resolvers/JSResolverHelper.cpp index 11f180055..d978677e4 100644 --- a/src/libtomahawk/resolvers/JSResolverHelper.cpp +++ b/src/libtomahawk/resolvers/JSResolverHelper.cpp @@ -429,6 +429,13 @@ JSResolverHelper::setResolverConfig( const QVariantMap& config ) } +QString +JSResolverHelper::acountId() +{ + return m_resolver->d_func()->accountId; +} + + void JSResolverHelper::addCustomUrlHandler( const QString& protocol, const QString& callbackFuncName, diff --git a/src/libtomahawk/resolvers/JSResolverHelper.h b/src/libtomahawk/resolvers/JSResolverHelper.h index e0a547657..6be3f8b50 100644 --- a/src/libtomahawk/resolvers/JSResolverHelper.h +++ b/src/libtomahawk/resolvers/JSResolverHelper.h @@ -45,6 +45,13 @@ public: JSResolverHelper( const QString& scriptPath, JSResolver* parent ); void setResolverConfig( const QVariantMap& config ); + /** + * Get the instance unique account id for this resolver. + * + * INTERNAL USE ONLY! + */ + Q_INVOKABLE QString acountId(); + Q_INVOKABLE void addCustomUrlHandler( const QString& protocol, const QString& callbackFuncName, const QString& isAsynchronous = "false" ); Q_INVOKABLE void reportStreamUrl( const QString& qid, const QString& streamUrl ); Q_INVOKABLE void reportStreamUrl( const QString& qid, const QString& streamUrl, const QVariantMap& headers );