diff options
Diffstat (limited to 'src/plugins/Transports/http/streamreader.cpp')
| -rw-r--r-- | src/plugins/Transports/http/streamreader.cpp | 50 |
1 files changed, 8 insertions, 42 deletions
diff --git a/src/plugins/Transports/http/streamreader.cpp b/src/plugins/Transports/http/streamreader.cpp index 1d482259a..074b32683 100644 --- a/src/plugins/Transports/http/streamreader.cpp +++ b/src/plugins/Transports/http/streamreader.cpp @@ -26,7 +26,7 @@ StreamReader::StreamReader(const QString &name, QObject *parent) : QIODevice(parent) { m_downloader = new Downloader(this, name); - connect(m_downloader, SIGNAL(readyRead()), SIGNAL(readyRead())); + connect(m_downloader, SIGNAL(ready()), SIGNAL(ready())); } StreamReader::~StreamReader() @@ -50,14 +50,10 @@ qint64 StreamReader::bytesToWrite () const return -1; } -bool StreamReader::canReadLine () const -{ - return false; -} - void StreamReader::close () { m_downloader->abort(); + QIODevice::close(); } bool StreamReader::isSequential () const @@ -65,49 +61,20 @@ bool StreamReader::isSequential () const return true; } -bool StreamReader::open ( OpenMode mode ) +bool StreamReader::open (OpenMode mode) { if (mode != QIODevice::ReadOnly) return false; - //downloadFile(); - setOpenMode(QIODevice::ReadOnly); - if (m_downloader->isReady()) - return true; - else - return false; + QIODevice::open(mode); + return m_downloader->isReady(); } -bool StreamReader::reset () +bool StreamReader::seek (qint64 pos) { - QIODevice::reset(); - return true; -} - -bool StreamReader::seek ( qint64 pos ) -{ - QIODevice::seek(pos); + Q_UNUSED(pos); return false; } -qint64 StreamReader::size () const -{ - return bytesAvailable (); -} - -bool StreamReader::waitForBytesWritten (int msecs) -{ - Q_UNUSED(msecs); - //usleep(msecs*1000); - return true; -} - -bool StreamReader::waitForReadyRead (int msecs) -{ - Q_UNUSED(msecs); - //usleep(msecs*1000); - return true; -} - qint64 StreamReader::readData(char* data, qint64 maxlen) { return m_downloader->read (data, maxlen); @@ -115,7 +82,7 @@ qint64 StreamReader::readData(char* data, qint64 maxlen) qint64 StreamReader::writeData(const char*, qint64) { - return 0; + return -1; } void StreamReader::downloadFile() @@ -128,7 +95,6 @@ QString StreamReader::contentType() m_downloader->mutex()->lock (); m_contentType = m_downloader->contentType(); m_downloader->mutex()->unlock(); - qApp->processEvents(); qDebug("StreamReader: content type: %s", qPrintable(m_contentType)); return m_contentType; } |
