From 4310e5fa1b942cb6216d9f700031fb8f7a412606 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 7 Sep 2017 13:29:27 +0200 Subject: benchmarks: avoid "Empty filename passed to function" warnings Add isEmpty() checks to avoid annoying warnings from QFileSystemEngine for Unix. Change-Id: I20b4f07605692271468dfc26b3c968406323de98 Reviewed-by: Thiago Macieira --- tests/benchmarks/creationtime/tst_creationtime.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tests/benchmarks/creationtime/tst_creationtime.cpp') diff --git a/tests/benchmarks/creationtime/tst_creationtime.cpp b/tests/benchmarks/creationtime/tst_creationtime.cpp index fa72aa86..9539ee1b 100644 --- a/tests/benchmarks/creationtime/tst_creationtime.cpp +++ b/tests/benchmarks/creationtime/tst_creationtime.cpp @@ -92,9 +92,12 @@ static void addTestRows(QQmlEngine *engine, const QString &sourcePath, const QSt if (QFile::exists(filePath)) { QTest::newRow(qPrintable(name)) << QUrl::fromLocalFile(filePath); break; - } else if (QFile::exists(QQmlFile::urlToLocalFileOrQrc(filePath))) { - QTest::newRow(qPrintable(name)) << QUrl(filePath); - break; + } else { + filePath = QQmlFile::urlToLocalFileOrQrc(filePath); + if (!filePath.isEmpty() && QFile::exists(filePath)) { + QTest::newRow(qPrintable(name)) << QUrl(filePath); + break; + } } } } -- cgit v1.2.3