1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 22:26:32 +02:00

* Respond to pings from external resolver.

This commit is contained in:
Christian Muehlhaeuser
2012-06-25 21:12:44 +02:00
parent 2fd970d24d
commit a9e0c3c460
2 changed files with 17 additions and 1 deletions

View File

@@ -255,7 +255,11 @@ ScriptResolver::handleMsg( const QByteArray& msg )
setupConfWidget( m ); setupConfWidget( m );
return; return;
} }
else if ( msgtype == "status" )
{
sendStatus();
return;
}
else if ( msgtype == "results" ) else if ( msgtype == "results" )
{ {
const QString qid = m.value( "qid" ).toString(); const QString qid = m.value( "qid" ).toString();
@@ -333,6 +337,7 @@ ScriptResolver::cmdExited( int code, QProcess::ExitStatus status )
} }
} }
void void
ScriptResolver::resolve( const Tomahawk::query_ptr& query ) ScriptResolver::resolve( const Tomahawk::query_ptr& query )
{ {
@@ -358,6 +363,16 @@ ScriptResolver::resolve( const Tomahawk::query_ptr& query )
} }
void
ScriptResolver::sendStatus()
{
QVariantMap msg;
msg[ "_msgtype" ] = "status";
msg[ "_status" ] = 1;
sendMessage( msg );
}
void void
ScriptResolver::doSetup( const QVariantMap& m ) ScriptResolver::doSetup( const QVariantMap& m )
{ {

View File

@@ -77,6 +77,7 @@ private:
void sendMsg( const QByteArray& msg ); void sendMsg( const QByteArray& msg );
void doSetup( const QVariantMap& m ); void doSetup( const QVariantMap& m );
void setupConfWidget( const QVariantMap& m ); void setupConfWidget( const QVariantMap& m );
void sendStatus();
void startProcess(); void startProcess();