diff --git a/src/map/maplist.cpp b/src/map/maplist.cpp index 04d46bfc..5cdae0be 100644 --- a/src/map/maplist.cpp +++ b/src/map/maplist.cpp @@ -78,16 +78,7 @@ bool MapList::loadFile(const QString &path, bool *atlas, bool dir) } } -bool MapList::loadFile(const QString &path) -{ - bool atlas; - - _errorString.clear(); - - return loadFile(path, &atlas, false); -} - -bool MapList::loadDir(const QString &path) +bool MapList::loadDirR(const QString &path) { QDir md(path); md.setFilter(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot); @@ -95,14 +86,12 @@ bool MapList::loadDir(const QString &path) QFileInfoList ml = md.entryInfoList(); bool atlas, ret = true; - _errorString.clear(); - for (int i = 0; i < ml.size(); i++) { const QFileInfo &fi = ml.at(i); QString suffix = fi.suffix().toLower(); if (fi.isDir() && fi.fileName() != "set") { - if (!loadDir(fi.absoluteFilePath())) + if (!loadDirR(fi.absoluteFilePath())) ret = false; } else if (filter().contains("*." + suffix)) { if (!loadFile(fi.absoluteFilePath(), &atlas, true)) @@ -115,6 +104,20 @@ bool MapList::loadDir(const QString &path) return ret; } +bool MapList::loadFile(const QString &path) +{ + bool atlas; + + _errorString.clear(); + return loadFile(path, &atlas, false); +} + +bool MapList::loadDir(const QString &path) +{ + _errorString.clear(); + return loadDirR(path); +} + void MapList::clear() { for (int i = 0; i < _maps.count(); i++) diff --git a/src/map/maplist.h b/src/map/maplist.h index a12d055a..93481320 100644 --- a/src/map/maplist.h +++ b/src/map/maplist.h @@ -26,6 +26,7 @@ public: private: bool loadFile(const QString &path, bool *atlas, bool dir); + bool loadDirR(const QString &path); Map *loadListEntry(const QByteArray &line);