diff --git a/data/www/auth.html b/data/www/auth.html index a8aac4c37..49358ef7c 100644 --- a/data/www/auth.html +++ b/data/www/auth.html @@ -44,7 +44,7 @@ - Tomahawk - Powered by Playdar + Tomahawk - Powered by Playdar
diff --git a/data/www/tomahawk_banner_small.png b/data/www/tomahawk_banner_small.png new file mode 100644 index 000000000..83a818d17 Binary files /dev/null and b/data/www/tomahawk_banner_small.png differ diff --git a/resources.qrc b/resources.qrc index fc3705795..231eb32b2 100644 --- a/resources.qrc +++ b/resources.qrc @@ -85,5 +85,6 @@ ./data/icons/audio-x-generic-16x16.png ./data/www/auth.html ./data/www/auth.na.html +./data/www/tomahawk_banner_small.png diff --git a/src/web/api_v1.cpp b/src/web/api_v1.cpp index c5e65472c..36c3587d3 100644 --- a/src/web/api_v1.cpp +++ b/src/web/api_v1.cpp @@ -165,7 +165,7 @@ Api_v1::stat( QxtWebRequestEvent* event ) if( event->url.hasQueryItem( "auth" ) ) { // check for auth status - DatabaseCommand_ClientAuthValid* dbcmd = new DatabaseCommand_ClientAuthValid( event->url.queryItemValue( "auth" ), this ); + DatabaseCommand_ClientAuthValid* dbcmd = new DatabaseCommand_ClientAuthValid( event->url.queryItemValue( "auth" ) ); connect( dbcmd, SIGNAL( authValid( QString, QString, bool ) ), this, SLOT( statResult( QString, QString, bool ) ) ); Database::instance()->enqueue( QSharedPointer(dbcmd) ); } @@ -215,11 +215,17 @@ Api_v1::resolve( QxtWebRequestEvent* event ) void -Api_v1::staticdata( QxtWebRequestEvent* event ) +Api_v1::staticdata( QxtWebRequestEvent* event, const QString& str ) { - if( event->url.path().contains( "playdar_auth_logo.gif" ) ) + qDebug() << "STATIC request:" << event << str; + if( str.contains( "tomahawk_auth_logo.png" ) ) { - // TODO handle + QFile f( RESPATH "www/tomahawk_banner_small.png" ); + f.open( QIODevice::ReadOnly ); + QByteArray data = f.readAll(); + QxtWebPageEvent * e = new QxtWebPageEvent( event->sessionID, event->requestID, data ); + e->contentType = "image/png"; + postEvent( e ); } } diff --git a/src/web/api_v1.h b/src/web/api_v1.h index 28b14678a..73f2c68b6 100644 --- a/src/web/api_v1.h +++ b/src/web/api_v1.h @@ -53,7 +53,7 @@ public slots: void stat( QxtWebRequestEvent* event ); void statResult( const QString& clientToken, const QString& name, bool valid ); void resolve( QxtWebRequestEvent* event ); - void staticdata( QxtWebRequestEvent* event ); + void staticdata( QxtWebRequestEvent* event,const QString& ); void get_results( QxtWebRequestEvent* event ); void sendJSON( const QVariantMap& m, QxtWebRequestEvent* event );