1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Cosmetics

This commit is contained in:
Martin Tůma 2023-12-09 18:48:44 +01:00
parent bac55e317b
commit eee4f31369
4 changed files with 10 additions and 10 deletions

View File

@ -180,7 +180,7 @@ bool OZF::readTileTable()
bool OZF::open() bool OZF::open()
{ {
if (!_file.open(QIODevice::ReadOnly)) { if (!_file.open(QIODevice::ReadOnly)) {
_error = _file.errorString(); _errorString = _file.errorString();
return false; return false;
} }
@ -188,13 +188,13 @@ bool OZF::open()
return true; return true;
if (!readHeaders()) { if (!readHeaders()) {
_error = "Invalid header"; _errorString = "Invalid header";
_file.close(); _file.close();
return false; return false;
} }
if (!readTileTable()) { if (!readTileTable()) {
_error = "Invalid tile table"; _errorString = "Invalid tile table";
_file.close(); _file.close();
return false; return false;
} }

View File

@ -17,7 +17,7 @@ public:
bool open(); bool open();
void close() {_file.close();} void close() {_file.close();}
const QString &errorString() const {return _error;} const QString &errorString() const {return _errorString;}
QString fileName() const {return _file.fileName();} QString fileName() const {return _file.fileName();}
bool isOpen() const {return _file.isOpen();} bool isOpen() const {return _file.isOpen();}
@ -50,7 +50,7 @@ private:
quint8 _key; quint8 _key;
QList<Zoom> _zooms; QList<Zoom> _zooms;
QFile _file; QFile _file;
QString _error; QString _errorString;
}; };
#endif // OZF_H #endif // OZF_H

View File

@ -47,7 +47,7 @@ static quint64 number(const char* data, size_t size, int base = 8)
bool Tar::open() bool Tar::open()
{ {
if (!_file.open(QIODevice::ReadOnly)) { if (!_file.open(QIODevice::ReadOnly)) {
_error = _file.errorString(); _errorString = _file.errorString();
return false; return false;
} }
@ -74,7 +74,7 @@ bool Tar::loadTar()
if (ret < BLOCKSIZE) { if (ret < BLOCKSIZE) {
_file.close(); _file.close();
_index.clear(); _index.clear();
_error = "Error reading header block"; _errorString = "Error reading header block";
return false; return false;
} }
size = number(hdr->size, sizeof(hdr->size)); size = number(hdr->size, sizeof(hdr->size));
@ -82,7 +82,7 @@ bool Tar::loadTar()
if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE)) { if (!_file.seek(_file.pos() + BLOCKCOUNT(size) * BLOCKSIZE)) {
_file.close(); _file.close();
_index.clear(); _index.clear();
_error = "Error skipping data blocks"; _errorString = "Error skipping data blocks";
return false; return false;
} }
} }

View File

@ -12,7 +12,7 @@ public:
bool open(); bool open();
void close() {_file.close();} void close() {_file.close();}
const QString &errorString() const {return _error;} const QString &errorString() const {return _errorString;}
QStringList files() const {return _index.keys();} QStringList files() const {return _index.keys();}
QByteArray file(const QString &name); QByteArray file(const QString &name);
@ -27,7 +27,7 @@ private:
QFile _file; QFile _file;
QMap<QString, quint64> _index; QMap<QString, quint64> _index;
QString _error; QString _errorString;
}; };
#endif // TAR_H #endif // TAR_H