Mercurial > hg > svcore
comparison data/fileio/FileSource.cpp @ 764:95d4a59295b7 qt5
Fix typo in signal name
| author | Chris Cannam |
|---|---|
| date | Tue, 12 Mar 2013 16:34:10 +0000 |
| parents | 2b3a8ae04597 |
| children | 12aff5a181bc 3cc81dbc31bb |
comparison
equal
deleted
inserted
replaced
| 763:2b3a8ae04597 | 764:95d4a59295b7 |
|---|---|
| 449 this, SLOT(readyRead())); | 449 this, SLOT(readyRead())); |
| 450 connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), | 450 connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), |
| 451 this, SLOT(replyFailed(QNetworkReply::NetworkError))); | 451 this, SLOT(replyFailed(QNetworkReply::NetworkError))); |
| 452 connect(m_reply, SIGNAL(finished()), | 452 connect(m_reply, SIGNAL(finished()), |
| 453 this, SLOT(replyFinished())); | 453 this, SLOT(replyFinished())); |
| 454 connect(m_reply, SIGNAL(metadataChanged()), | 454 connect(m_reply, SIGNAL(metaDataChanged()), |
| 455 this, SLOT(metadataChanged())); | 455 this, SLOT(metaDataChanged())); |
| 456 connect(m_reply, SIGNAL(downloadProgress(qint64, qint64)), | 456 connect(m_reply, SIGNAL(downloadProgress(qint64, qint64)), |
| 457 this, SLOT(downloadProgress(qint64, qint64))); | 457 this, SLOT(downloadProgress(qint64, qint64))); |
| 458 } | 458 } |
| 459 | 459 |
| 460 void | 460 void |
| 604 { | 604 { |
| 605 m_localFile->write(m_reply->readAll()); | 605 m_localFile->write(m_reply->readAll()); |
| 606 } | 606 } |
| 607 | 607 |
| 608 void | 608 void |
| 609 FileSource::metadataChanged() | 609 FileSource::metaDataChanged() |
| 610 { | 610 { |
| 611 #ifdef DEBUG_FILE_SOURCE | 611 #ifdef DEBUG_FILE_SOURCE |
| 612 std::cerr << "FileSource::metadataChanged" << std::endl; | 612 std::cerr << "FileSource::metaDataChanged" << std::endl; |
| 613 #endif | 613 #endif |
| 614 | 614 |
| 615 if (!m_reply) { | 615 if (!m_reply) { |
| 616 std::cerr << "WARNING: FileSource::metadataChanged() called without a reply object being known to us" << std::endl; | 616 std::cerr << "WARNING: FileSource::metaDataChanged() called without a reply object being known to us" << std::endl; |
| 617 return; | 617 return; |
| 618 } | 618 } |
| 619 | 619 |
| 620 int status = | 620 int status = |
| 621 m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); | 621 m_reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); |
| 622 | 622 |
| 623 if (status / 100 == 3) { | 623 if (status / 100 == 3) { |
| 624 QString location = m_reply->header | 624 QString location = m_reply->header |
| 625 (QNetworkRequest::LocationHeader).toString(); | 625 (QNetworkRequest::LocationHeader).toString(); |
| 626 #ifdef DEBUG_FILE_SOURCE | 626 #ifdef DEBUG_FILE_SOURCE |
| 627 std::cerr << "FileSource::metadataChanged: redirect to \"" | 627 std::cerr << "FileSource::metaDataChanged: redirect to \"" |
| 628 << location << "\" received" << std::endl; | 628 << location << "\" received" << std::endl; |
| 629 #endif | 629 #endif |
| 630 if (location != "") { | 630 if (location != "") { |
| 631 QUrl newUrl(location); | 631 QUrl newUrl(location); |
| 632 if (newUrl != m_url) { | 632 if (newUrl != m_url) { |
| 652 m_errorString = QString("%1 %2") | 652 m_errorString = QString("%1 %2") |
| 653 .arg(status) | 653 .arg(status) |
| 654 .arg(m_reply->attribute | 654 .arg(m_reply->attribute |
| 655 (QNetworkRequest::HttpReasonPhraseAttribute).toString()); | 655 (QNetworkRequest::HttpReasonPhraseAttribute).toString()); |
| 656 #ifdef DEBUG_FILE_SOURCE | 656 #ifdef DEBUG_FILE_SOURCE |
| 657 std::cerr << "FileSource::metadataChanged: " | 657 std::cerr << "FileSource::metaDataChanged: " |
| 658 << m_errorString << std::endl; | 658 << m_errorString << std::endl; |
| 659 #endif | 659 #endif |
| 660 } else { | 660 } else { |
| 661 #ifdef DEBUG_FILE_SOURCE | 661 #ifdef DEBUG_FILE_SOURCE |
| 662 std::cerr << "FileSource::metadataChanged: " | 662 std::cerr << "FileSource::metaDataChanged: " |
| 663 << m_lastStatus << std::endl; | 663 << m_lastStatus << std::endl; |
| 664 #endif | 664 #endif |
| 665 m_contentType = | 665 m_contentType = |
| 666 m_reply->header(QNetworkRequest::ContentTypeHeader).toString(); | 666 m_reply->header(QNetworkRequest::ContentTypeHeader).toString(); |
| 667 } | 667 } |
