From 3657405fe766d9aca719177a6f9614c4dc08c47e Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 29 Jul 2020 20:12:26 +0200 Subject: QFileInfo: make stat method public MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Forcing the reading of all file system attributes is generally useful in multi-threaded applications, and has at least one more use case in Qt. Using it in QFileSystemWatcher on Windows avoids several file system accesses. Task-number: QTBUG-41373 Change-Id: Ib3c3243fd083142393ad46d62f49cb4f7bfda17c Reviewed-by: MÃ¥rten Nordheim --- src/corelib/io/qfileinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/io/qfileinfo.cpp') diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 8bf7115b58..7ed840052e 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -308,6 +308,8 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request) refreshes the file information: refresh(). If you want to switch off a QFileInfo's caching and force it to access the file system every time you request information from it call setCaching(false). + If you want to make sure that all information is read from the + file system, use stat(). \sa QDir, QFile */ @@ -1509,8 +1511,6 @@ void QFileInfo::setCaching(bool enable) } /*! - \internal - Reads all attributes from the file system. This is useful when information about the file system is collected in a -- cgit v1.2.3