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

Add sendJsonOk

This commit is contained in:
Uwe L. Korn 2014-01-28 22:40:02 +00:00
parent c87f0c47cd
commit fb86d72c41
2 changed files with 9 additions and 0 deletions

View File

@ -515,6 +515,14 @@ Api_v1::apiCallFailed( QxtWebRequestEvent* event, const QString& method )
sendPlain404( event, QString( "Method \"%1\" for API 1.5 not found" ).arg( method ), "Method in API 1.5 not found" );
}
void
Api_v1::sendJsonOk( QxtWebRequestEvent* event )
{
QxtWebPageEvent * e = new QxtWebPageEvent( event->sessionID, event->requestID, "{ result: \"ok\" }" );
e->contentType = "application/json";
postEvent( e );
}
void
Api_v1::sendJsonError( QxtWebRequestEvent* event, const QString& message )

View File

@ -83,6 +83,7 @@ public slots:
// load an html template from a file, replace args from map
// then serve
void sendJsonError( QxtWebRequestEvent* event, const QString& message );
void sendJsonOk( QxtWebRequestEvent* event );
void sendWebpageWithArgs( QxtWebRequestEvent* event, const QString& filenameSource, const QHash< QString, QString >& args );
void index( QxtWebRequestEvent* event );