From cc2fdce35e6a958e021b4d4cdc0ace1a91b06d0c Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Wed, 23 Jun 2021 09:33:10 +0200 Subject: Extend documentation for QFile:copy() - Add information about symlinks and file metadata. - Reflow text. - Extract text common to both overloads to a .qdocinc file for consistency and to avoid duplication. Pick-to: 6.2 6.1 5.15 Fixes: QTBUG-94706 Change-Id: I3c730fd63f4018a1a573bb56751fedd2270a3247 Reviewed-by: Thiago Macieira --- src/corelib/io/qfile.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/corelib/io/qfile.cpp') diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 07b40527cb..e031e9c091 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -755,13 +755,9 @@ QFile::link(const QString &fileName, const QString &linkName) } /*! - Copies the file currently specified by fileName() to a file called - \a newName. Returns \c true if successful; otherwise returns \c false. + Copies the file named fileName() to \a newName. - Note that if a file with the name \a newName already exists, - copy() returns \c false (i.e. QFile will not overwrite it). - - The source file is closed before it is copied. + \include qfile-copy.qdocinc \sa setFileName() */ @@ -867,11 +863,9 @@ QFile::copy(const QString &newName) /*! \overload - Copies the file \a fileName to \a newName. Returns \c true if successful; - otherwise returns \c false. + Copies the file named \a fileName to \a newName. - If a file with the name \a newName already exists, copy() returns \c false - (i.e., QFile will not overwrite it). + \include qfile-copy.qdocinc \sa rename() */ -- cgit v1.2.3