1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-01-17 22:38:33 +01:00

serve up the tomahawk logo ont he auth page

don't give parents to dbcmds
This commit is contained in:
Leo Franchi 2011-02-28 22:30:10 -05:00
parent 50e623f763
commit 51a004c7eb
5 changed files with 13 additions and 6 deletions

View File

@ -44,7 +44,7 @@
</head>
<body>
<a href="http://www.playdar.org/" title="Tomahawk - Powered by Playdar" id="head">
<img alt="Tomahawk - Powered by Playdar" src="/static/playdar_auth_logo.gif" width="233" height="68"/>
<img alt="Tomahawk - Powered by Playdar" src="/staticdata/tomahawk_auth_logo.png" width="233" height="68"/>
</a>
<div id="content">

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -85,5 +85,6 @@
<file>./data/icons/audio-x-generic-16x16.png</file>
<file>./data/www/auth.html</file>
<file>./data/www/auth.na.html</file>
<file>./data/www/tomahawk_banner_small.png</file>
</qresource>
</RCC>

View File

@ -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<DatabaseCommand>(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 );
}
}

View File

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