Skip to content

Commit 972a921

Browse files
committed
[BUGFIX] Fixed Qt4 compatibility
1 parent 54d2946 commit 972a921

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

parser/FileBuffer.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#include "FileBuffer.h"
22

3+
34
FileView::FileView(QString &path, bufsize_t maxSize)
45
: AbstractFileBuffer(path), fIn (path)
56
{
6-
if (fIn.open(QFileDevice::ReadOnly) == false) {
7+
if (fIn.open(QIODevice::ReadOnly) == false) {
78
throw FileBufferException("Cannot open the file: " + path);
89
}
910
this->fileSize = fIn.size();
@@ -39,9 +40,8 @@ bufsize_t FileView::getMappableSize(QFile &fIn)
3940

4041
ByteBuffer* AbstractFileBuffer::read(QString &path, bufsize_t minBufSize)
4142
{
42-
//printf("reading file...");
4343
QFile fIn(path);
44-
if (fIn.open(QFileDevice::ReadOnly) == false) {
44+
if (fIn.open(QIODevice::ReadOnly) == false) {
4545
throw FileBufferException("Cannot open the file: " + path);
4646
}
4747
ByteBuffer *bufferedFile = read(fIn, minBufSize);
@@ -96,9 +96,8 @@ bufsize_t AbstractFileBuffer::getReadableSize(QFile &fIn)
9696
bufsize_t AbstractFileBuffer::getReadableSize(QString &path)
9797
{
9898
if (path.length() == 0) return 0;
99-
10099
QFile fIn(path);
101-
if (fIn.open(QFileDevice::ReadOnly) == false) return 0;
100+
if (fIn.open(QIODevice::ReadOnly) == false) return 0;
102101
bufsize_t size = getReadableSize(fIn);
103102
fIn.close();
104103
return size;

0 commit comments

Comments
 (0)