diff --git a/src/libtomahawk/resolvers/QtScriptResolver.cpp b/src/libtomahawk/resolvers/QtScriptResolver.cpp index 1bfa4ea5e..d20d411eb 100644 --- a/src/libtomahawk/resolvers/QtScriptResolver.cpp +++ b/src/libtomahawk/resolvers/QtScriptResolver.cpp @@ -176,6 +176,20 @@ QtScriptResolverHelper::addCustomUrlHandler( const QString& protocol, const QStr } +QByteArray +QtScriptResolverHelper::base64Encode( const QByteArray& input ) +{ + return input.toBase64(); +} + + +QByteArray +QtScriptResolverHelper::base64Decode( const QByteArray& input ) +{ + return QByteArray::fromBase64( input ); +} + + QSharedPointer< QIODevice > QtScriptResolverHelper::customIODeviceFactory( const Tomahawk::result_ptr& result ) { diff --git a/src/libtomahawk/resolvers/QtScriptResolver.h b/src/libtomahawk/resolvers/QtScriptResolver.h index 85d10d59e..c2dae5210 100644 --- a/src/libtomahawk/resolvers/QtScriptResolver.h +++ b/src/libtomahawk/resolvers/QtScriptResolver.h @@ -53,6 +53,9 @@ public: Q_INVOKABLE void addCustomUrlHandler( const QString& protocol, const QString& callbackFuncName ); + Q_INVOKABLE QByteArray base64Encode( const QByteArray& input ); + Q_INVOKABLE QByteArray base64Decode( const QByteArray& input ); + QSharedPointer customIODeviceFactory( const Tomahawk::result_ptr& result ); public slots: