本文整理汇总了C++中QNetworkReply::waitForReadyRead方法的典型用法代码示例。如果您正苦于以下问题:C++ QNetworkReply::waitForReadyRead方法的具体用法?C++ QNetworkReply::waitForReadyRead怎么用?C++ QNetworkReply::waitForReadyRead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QNetworkReply
的用法示例。
在下文中一共展示了QNetworkReply::waitForReadyRead方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: req
void
AmpacheTrackForUrlWorker::run()
{
m_urlTrack = 0;
m_urlAlbum = 0;
m_urlArtist = 0;
m_urlTrackId = 0;
m_urlAlbumId = 0;
m_urlArtistId = 0;
//send url_to_song to Ampache
QString requestUrl =
QString( "%1/server/xml.server.php?action=url_to_song&auth=%2&url=%3" )
.arg( m_server, m_sessionId, QUrl::toPercentEncoding( m_url.url() ) );
QNetworkRequest req( requestUrl );
QNetworkReply *reply = The::networkAccessManager()->get( req );
if( reply->waitForReadyRead(-1) )
{
if( reply->error() == QNetworkReply::ContentAccessDenied )
{
debug() << "Trying to re-authenticate Ampache..";
emit authenticationNeeded();
}
}
parseTrack( reply->readAll() );
m_track = Meta::TrackPtr( m_urlTrack );
m_proxy->updateTrack( m_track );
reply->deleteLater();
}
示例2: waitForReadyRead
bool QNetworkReplyProto::waitForReadyRead(int msecs)
{
QNetworkReply *item = qscriptvalue_cast<QNetworkReply*>(thisObject());
if (item)
return item->waitForReadyRead(msecs);
return false;
}