From 9bccfb80bbcfe5cb76cccf325217f5a86441315c Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Mon, 1 Jul 2024 01:21:46 +0300 Subject: [PATCH] QTemporaryFile: de-duplicate API docs wrt. note about rename() method Pick-to: 6.7 Change-Id: I57bcf0b40785fd15aba0790673e7723b132f587c Reviewed-by: Ivan Solovev Reviewed-by: Edward Welbourne (cherry picked from commit bf8fb9c3d94bfa9dcb3d0b181663bab245650ab3) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qtemporaryfile.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 4e48a18d919..9107b800c5d 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -598,9 +598,12 @@ QString QTemporaryFilePrivate::defaultTemplateName() be placed into the temporary path as returned by QDir::tempPath(). If you specify your own filename, a relative file path will not be placed in the temporary directory by default, but be relative to the current working directory. + +//! [note-about-rename-method] It is important to specify the correct directory if the rename() function will be called, as QTemporaryFile can only rename files within the same volume / filesystem as the temporary file itself was created on. +//! [note-about-rename-method] Specified filenames can contain the following template \c XXXXXX (six upper case "X" characters), which will be replaced by the @@ -658,11 +661,8 @@ QTemporaryFile::QTemporaryFile() If \a templateName is a relative path, the path will be relative to the current working directory. You can use QDir::tempPath() to construct \a - templateName if you want use the system's temporary directory. It is - important to specify the correct directory if the rename() function will be - called, as QTemporaryFile can only rename files within the same volume / - filesystem as the temporary file itself was created on. - + templateName if you want use the system's temporary directory. + \include qtemporaryfile.cpp note-about-rename-method \sa open(), fileTemplate() */ @@ -695,10 +695,8 @@ QTemporaryFile::QTemporaryFile(QObject *parent) If \a templateName is a relative path, the path will be relative to the current working directory. You can use QDir::tempPath() to construct \a - templateName if you want use the system's temporary directory. It is - important to specify the correct directory if the rename() function will be - called, as QTemporaryFile can only rename files within the same volume / - filesystem as the temporary file itself was created on. + templateName if you want use the system's temporary directory. + \include qtemporaryfile.cpp note-about-rename-method \sa open(), fileTemplate() */ @@ -823,10 +821,8 @@ QString QTemporaryFile::fileTemplate() const If \a name contains a relative file path, the path will be relative to the current working directory. You can use QDir::tempPath() to construct \a - name if you want use the system's temporary directory. It is important to - specify the correct directory if the rename() function will be called, as - QTemporaryFile can only rename files within the same volume / filesystem as - the temporary file itself was created on. + name if you want use the system's temporary directory. + \include qtemporaryfile.cpp note-about-rename-method \sa fileTemplate() */