Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Dec 9, 2023
1 parent bac55e3 commit eee4f31
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/map/ozf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,21 @@ bool OZF::readTileTable()
bool OZF::open()
{
if (!_file.open(QIODevice::ReadOnly)) {
_error = _file.errorString();
_errorString = _file.errorString();
return false;
}

if (!_zooms.isEmpty())
return true;

if (!readHeaders()) {
_error = "Invalid header";
_errorString = "Invalid header";
_file.close();
return false;
}

if (!readTileTable()) {
_error = "Invalid tile table";
_errorString = "Invalid tile table";
_file.close();
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/map/ozf.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class OZF

bool open();
void close() {_file.close();}
const QString &errorString() const {return _error;}
const QString &errorString() const {return _errorString;}

QString fileName() const {return _file.fileName();}
bool isOpen() const {return _file.isOpen();}
Expand Down Expand Up @@ -50,7 +50,7 @@ class OZF
quint8 _key;
QList<Zoom> _zooms;
QFile _file;
QString _error;
QString _errorString;
};

#endif // OZF_H
6 changes: 3 additions & 3 deletions src/map/tar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static quint64 number(const char* data, size_t size, int base = 8)
bool Tar::open()
{
if (!_file.open(QIODevice::ReadOnly)) {
_error = _file.errorString();
_errorString = _file.errorString();
return false;
}

Expand All @@ -74,15 +74,15 @@ bool Tar::loadTar()
if (ret < BLOCKSIZE) {
_file.close();
_index.clear();
_error = "Error reading header block";
_errorString = "Error reading header block";
return false;
}
size = number(hdr->size, sizeof(hdr->size));
_index.insert(hdr->name, _file.pos() / BLOCKSIZE - 1);
if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE)) {
_file.close();
_index.clear();
_error = "Error skipping data blocks";
_errorString = "Error skipping data blocks";
return false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/map/tar.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Tar

bool open();
void close() {_file.close();}
const QString &errorString() const {return _error;}
const QString &errorString() const {return _errorString;}

QStringList files() const {return _index.keys();}
QByteArray file(const QString &name);
Expand All @@ -27,7 +27,7 @@ class Tar

QFile _file;
QMap<QString, quint64> _index;
QString _error;
QString _errorString;
};

#endif // TAR_H

0 comments on commit eee4f31

Please sign in to comment.