From 64e3f48e3b7d2a7b71a7e46cbba2e14ebf9e9471 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Wed, 12 Oct 2022 17:49:04 +0200 Subject: [PATCH] QDir: use QFileInfo::exists() directly static QFile::exists() calls static QFileInfo::exists(). Mention QFileInfo::exists in the QDir docs details. Change-Id: I35ba9b00f33376a4ceb2f27ab587d368a95e4fe5 Reviewed-by: Thiago Macieira --- src/corelib/io/qdir.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index d18f409983..5f6ed307c5 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -486,8 +486,8 @@ inline void QDirPrivate::initFileEngine() \snippet code/src_corelib_io_qdir.cpp 4 - (We could also use the static convenience function - QFile::exists().) + (We could also use one of the static convenience functions + QFileInfo::exists() or QFile::exists().) Traversing directories and reading a file: @@ -1882,7 +1882,7 @@ bool QDir::exists(const QString &name) const qWarning("QDir::exists: Empty or null file name"); return false; } - return QFile::exists(filePath(name)); + return QFileInfo::exists(filePath(name)); } /*!