Eliminate Qt message "QFileSystemEngine::fillMetaData: Empty filename passed to function"
ClosedPublic

Authored by marten on Oct 1 2018, 2:19 PM.

Details

Summary

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.

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.

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.

Test Plan

Built Marble with this change, observed that the message above is not printed.

Diff Detail

Repository
R34 Marble
Lint
Lint Skipped
Unit
Unit Tests Skipped
marten created this revision.Oct 1 2018, 2:19 PM
Restricted Application added projects: Marble, KDE Edu. · View Herald TranscriptOct 1 2018, 2:19 PM
Restricted Application added subscribers: kde-edu, marble-devel. · View Herald Transcript
marten requested review of this revision.Oct 1 2018, 2:19 PM
rahn accepted this revision.Feb 26 2019, 10:56 AM
This revision is now accepted and ready to land.Feb 26 2019, 10:56 AM
This revision was automatically updated to reflect the committed changes.