summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qiodevice_p.h
diff options
context:
space:
mode:
authorAlex Trotsenko <alex1973tr@gmail.com>2016-09-17 16:43:02 +0300
committerAlex Trotsenko <alex1973tr@gmail.com>2017-02-09 18:46:24 +0000
commit6e8fcab7e07717526c8ea6eac8785bf27fa090c3 (patch)
treea6ea9825b55b3b406515e88462c54b448ff672a6 /src/corelib/io/qiodevice_p.h
parent60563855e589cb51b4966ca51a4d390a2f1609a4 (diff)
Improve QIODevice::peek() performance on buffered devices
Since 5.7, QIODevice::peek() implementation is based on transaction mechanism. While technically it's correct, seeking backward on a buffered random-access device clears the internal buffer that affects the performance of reading. To solve the problem, this patch implements peek mode directly inside the reading procedure. Task-number: QTBUG-56032 Change-Id: Ic5269f76e44c491a0309e13aba87fa7cf7b9259f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/io/qiodevice_p.h')
-rw-r--r--src/corelib/io/qiodevice_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/io/qiodevice_p.h b/src/corelib/io/qiodevice_p.h
index 0e424b6831..71a326dd53 100644
--- a/src/corelib/io/qiodevice_p.h
+++ b/src/corelib/io/qiodevice_p.h
@@ -171,7 +171,7 @@ public:
void setReadChannelCount(int count);
void setWriteChannelCount(int count);
- qint64 read(char *data, qint64 maxSize);
+ qint64 read(char *data, qint64 maxSize, bool peeking = false);
virtual qint64 peek(char *data, qint64 maxSize);
virtual QByteArray peek(qint64 maxSize);