From 760b7d8ec25272eb1c347e5b13d0c6f2bd04e421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 6 Jan 2019 21:15:49 +0100 Subject: [PATCH] Do not try to repeatedly open a missing DEM file --- src/data/dem.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/data/dem.cpp b/src/data/dem.cpp index 722042ba..218d93a0 100644 --- a/src/data/dem.cpp +++ b/src/data/dem.cpp @@ -66,9 +66,10 @@ qreal DEM::elevation(const Coordinates &c) QMap::const_iterator it(_data.find(k)); if (it == _data.constEnd()) { QFile file(fileName(k)); - if (!file.open(QIODevice::ReadOnly)) + if (!file.open(QIODevice::ReadOnly)) { + _data.insert(k, QByteArray()); return NAN; - else { + } else { it = _data.insert(k, file.readAll()); return height(c, *it); }