From c6b82dc30dcaaec500ade4687d54ff2fbdbbc14c Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Tue, 9 Apr 2013 11:16:50 +0200 Subject: [PATCH] * Temporary work-around for losing the shared-pointer. --- src/web/Api_v1.cpp | 5 ++++- src/web/Api_v1.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/web/Api_v1.cpp b/src/web/Api_v1.cpp index b24555339..090565937 100644 --- a/src/web/Api_v1.cpp +++ b/src/web/Api_v1.cpp @@ -201,16 +201,19 @@ Api_v1::sid( QxtWebRequestEvent* event, QString unused ) void Api_v1::processSid( QxtWebRequestEvent* event, Tomahawk::result_ptr& rp, QSharedPointer< QIODevice >& iodev ) { - if ( !iodev || iodev.isNull() ) + tDebug( LOGVERBOSE ) << Q_FUNC_INFO; + if ( !iodev || !rp ) { return send404( event ); // 503? } + m_ioDevice = iodev; QxtWebPageEvent* e = new QxtWebPageEvent( event->sessionID, event->requestID, iodev.data() ); e->streaming = iodev->isSequential(); e->contentType = rp->mimetype().toLatin1(); if ( rp->size() > 0 ) e->headers.insert( "Content-Length", QString::number( rp->size() ) ); + postEvent( e ); } diff --git a/src/web/Api_v1.h b/src/web/Api_v1.h index 06cb411dc..a8f4a6c8a 100644 --- a/src/web/Api_v1.h +++ b/src/web/Api_v1.h @@ -78,7 +78,9 @@ public slots: private: void processSid( QxtWebRequestEvent* event, Tomahawk::result_ptr&, QSharedPointer< QIODevice >& ); + QxtWebRequestEvent* m_storedEvent; + QSharedPointer< QIODevice > m_ioDevice; }; #endif