<table><tr><td style="">marten created this revision.<br />marten added a reviewer: Marble.<br />Herald added projects: Marble, KDE Edu.<br />Herald added subscribers: kde-edu, marble-devel.<br />marten requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D15879">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>That message is frequently printed when scrolling or zooming to a part of the map which has not been visited before and which is not cached.</p>
<p>What seems to be happening is that TileLoader::scaledLowerLevelTile() calls TileLoader::tileFileName(), which resolves the tile ID into a relative path to the tile cache file by GeoSceneTileDataset::relativeTileFileName(). This is always a relative file name, so TileLoader::tileFileName() calls MarbleDirs::path() is called to make it absolute relative to the local or system Marble base paths. The problem is that if neither the local or system data file exists, which will be the case for a tile which is not cached yet, QDir::canonicalPath() returns a null string (according to the Qt API documentation). TileLoader::scaledLowerLevelTile() then calls QFile::exists() with this file name and Qt prints the warning message.</p>
<p>This change guards the call to QFile::exists() to not use it if the file name is empty. A null QImage is created in the same way as if the file did not exist.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Built Marble with this change, observed that the message above is not printed.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R34 Marble</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D15879">https://phabricator.kde.org/D15879</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/lib/marble/TileLoader.cpp</div></div></div><br /><div><strong>To: </strong>marten, Marble<br /><strong>Cc: </strong>marble-devel, kde-edu, torhamzed, jalvarez, mnafees, shentey, chaz6, dkolozsvari, narvaez, cmihalache, rahn, apol, nienhueser<br /></div>