summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-10-03 12:57:04 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-10-03 12:57:04 (GMT)
commit5e3ee3cbcf73bc0712e7da1e8be537e7614759c5 (patch)
treed3702e714d9dae5dd8de9f279c268e45e8422043
parentf4530d81d984b02df492fa66a1bc4446e9b70706 (diff)
Create directories only if they are actually needed
-rw-r--r--tools/vectorosm-tilecreator/main.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/vectorosm-tilecreator/main.cpp b/tools/vectorosm-tilecreator/main.cpp
index 768a502..e492301 100644
--- a/tools/vectorosm-tilecreator/main.cpp
+++ b/tools/vectorosm-tilecreator/main.cpp
@@ -65,13 +65,13 @@ QString tileFileName(const QCommandLineParser &parser, int x, int y, int zoomLev
{
QString const extension = parser.value("extension");
QString const outputDir = QString("%1/%2/%3").arg(parser.value("output")).arg(zoomLevel).arg(x);
- QDir().mkpath(outputDir);
QString const outputFile = QString("%1/%2.%3").arg(outputDir).arg(y).arg(extension);
return outputFile;
}
bool writeTile(GeoDataDocument* tile, const QString &outputFile)
{
+ QDir().mkpath(QFileInfo(outputFile).path());
if (!GeoDataDocumentWriter::write(outputFile, *tile)) {
qWarning() << "Could not write the file " << outputFile;
return false;