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

Get rid of unnecessary virtual stuff

This commit is contained in:
Martin Tůma 2021-10-02 09:24:00 +02:00
parent 54db2a5a6c
commit 29705b4cdf
6 changed files with 8 additions and 12 deletions

View File

@ -111,7 +111,7 @@ bool GMAPData::loadTile(const QDir &dir, bool baseMap)
return true;
}
GMAPData::GMAPData(const QString &fileName) : _fileName(fileName)
GMAPData::GMAPData(const QString &fileName) : MapData(fileName)
{
QString dataDirPath, typFilePath, baseMapPath;
if (!readXML(fileName, dataDirPath, typFilePath, baseMapPath))

View File

@ -14,8 +14,6 @@ public:
GMAPData(const QString &fileName);
~GMAPData();
const QString &fileName() const {return _fileName;}
static bool isGMAP(const QString &path);
private:
@ -27,7 +25,6 @@ private:
QString &baseMap);
bool loadTile(const QDir &dir, bool baseMap);
QString _fileName;
QList<const QString*> _files;
};

View File

@ -181,7 +181,7 @@ bool IMGData::createTileTree(const TileMap &tileMap)
return (_tileTree.Count() > 0);
}
IMGData::IMGData(const QString &fileName) : _fileName(fileName)
IMGData::IMGData(const QString &fileName) : MapData(fileName)
{
QFile file(fileName);
TileMap tileMap;

View File

@ -12,8 +12,6 @@ class IMGData : public MapData
public:
IMGData(const QString &fileName);
const QString &fileName() const {return _fileName;}
unsigned blockBits() const {return _blockBits;}
bool readBlock(QFile &file, int blockNum, char *data) const;
@ -27,7 +25,6 @@ private:
bool readIMGHeader(QFile &file);
bool createTileTree(const TileMap &tileMap);
QString _fileName;
quint8 _key;
unsigned _blockBits;
};

View File

@ -25,7 +25,8 @@ bool MapData::pointCb(VectorTile *tile, void *context)
}
MapData::MapData() : _typ(0), _style(0), _zooms(24, 28), _baseMap(false),
MapData::MapData(const QString &fileName)
: _fileName(fileName), _typ(0), _style(0), _zooms(24, 28), _baseMap(false),
_valid(false)
{
_polyCache.setMaxCost(CACHED_SUBDIVS_COUNT);

View File

@ -49,8 +49,8 @@ public:
{return id < other.id;}
};
MapData();
virtual ~MapData();
MapData(const QString &fileName);
~MapData();
const QString &name() const {return _name;}
const RectC &bounds() const {return _bounds;}
@ -63,7 +63,7 @@ public:
void load();
void clear();
virtual const QString &fileName() const = 0;
const QString &fileName() const {return _fileName;}
bool isValid() const {return _valid;}
QString errorString() const {return _errorString;}
@ -71,6 +71,7 @@ public:
protected:
typedef RTree<VectorTile*, double, 2> TileTree;
QString _fileName;
QString _name;
RectC _bounds;
SubFile *_typ;