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

Jonathan Marten noreply at phabricator.kde.org
Mon Oct 1 15:19:58 BST 2018


marten created this revision.
marten added a reviewer: Marble.
Herald added projects: Marble, KDE Edu.
Herald added subscribers: kde-edu, marble-devel.
marten requested review of this revision.

REVISION 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.

REPOSITORY
  R34 Marble

REVISION DETAIL
  https://phabricator.kde.org/D15879

AFFECTED FILES
  src/lib/marble/TileLoader.cpp

To: marten, #marble
Cc: marble-devel, kde-edu, torhamzed, jalvarez, mnafees, shentey, chaz6, dkolozsvari, narvaez, cmihalache, rahn, apol, nienhueser
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20181001/d0f73e55/attachment.html>


More information about the kde-edu mailing list