1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 07:49:42 +01:00

Provide base64 encode and decode to js resolvers

This commit is contained in:
Leo Franchi 2012-06-14 21:21:58 +02:00
parent 96d89e230c
commit c41c7eaa94
2 changed files with 17 additions and 0 deletions

@ -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 )
{

@ -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<QIODevice> customIODeviceFactory( const Tomahawk::result_ptr& result );
public slots: