From ec349e0c00e1cc53fe9cfd0348b8b86bc4422bc2 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Mon, 1 Jul 2024 20:53:48 +0300 Subject: [PATCH] QTemporaryFile: de-duplicate docs wrt. the file name relative/absolute Make it clearer in fileTemplate() and fileName() that the returned path will be relative or absolute depending on the specified file name template. Task-number: QTBUG-124653 Pick-to: 6.7 Change-Id: Iccb7a6d0ced2cadeacea7d14d3f6e924705b4d58 Reviewed-by: Thiago Macieira (cherry picked from commit 9a5e3e1f4064e275da3370f5dd27e87900da8c45) --- src/corelib/io/qtemporaryfile.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp index 5d00dc192e0..c4e50d2174d 100644 --- a/src/corelib/io/qtemporaryfile.cpp +++ b/src/corelib/io/qtemporaryfile.cpp @@ -672,9 +672,12 @@ QTemporaryFile::QTemporaryFile() which is calculated to be unique. //! [dynamic-part-of-filename] +//! [filename-relative-or-absolute-path] 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. +//! [filename-relative-or-absolute-path] + \include qtemporaryfile.cpp note-about-rename-method \sa open(), fileTemplate() @@ -704,9 +707,7 @@ QTemporaryFile::QTemporaryFile(QObject *parent) \include qtemporaryfile.cpp dynamic-part-of-filename - 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. + \include qtemporaryfile.cpp filename-relative-or-absolute-path \include qtemporaryfile.cpp note-about-rename-method \sa open(), fileTemplate() @@ -791,6 +792,10 @@ void QTemporaryFile::setAutoRemove(bool b) afterwards it will contain the fileTemplate() plus additional characters to make it unique. + The file name returned by this method is relative or absolute depending on + the file name template used to construct this object (or passed to + setFileTemplate()) being relative or absolute, respectively. + \sa fileTemplate() */ @@ -809,6 +814,10 @@ QString QTemporaryFile::fileName() const /*! Returns the file name template. + The file name template returned by this method, will be relative or + absolute depending on the file name template used to construct this object + (or passed to setFileTemplate()) being relative or absolute, respectively. + \sa setFileTemplate(), fileName(), {Default File Name Template} */ QString QTemporaryFile::fileTemplate() const @@ -830,12 +839,10 @@ QString QTemporaryFile::fileTemplate() const \include qtemporaryfile.cpp dynamic-part-of-filename - 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. + \include qtemporaryfile.cpp filename-relative-or-absolute-path \include qtemporaryfile.cpp note-about-rename-method - \sa fileTemplate() + \sa fileTemplate(), fileName() */ void QTemporaryFile::setFileTemplate(const QString &name) {