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. Fixes: QTBUG-94706 Change-Id: I3c730fd63f4018a1a573bb56751fedd2270a3247 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit cc2fdce35e6a958e021b4d4cdc0ace1a91b06d0c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
d1c2ddc8c8
commit
b8ea431fb1
11
src/corelib/doc/src/includes/qfile-copy.qdocinc
Normal file
11
src/corelib/doc/src/includes/qfile-copy.qdocinc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
This file is closed before it is copied.
|
||||||
|
|
||||||
|
If the copied file is a symbolic link (symlink), the
|
||||||
|
file it refers to is copied, not the link itself. With the
|
||||||
|
exception of permissions, which are copied, no other file metadata
|
||||||
|
is copied.
|
||||||
|
|
||||||
|
Returns \c true if successful; otherwise returns \c false.
|
||||||
|
|
||||||
|
Note that if a file with the name \a newName already exists,
|
||||||
|
copy() returns \c false. This means QFile will not overwrite it.
|
@ -755,13 +755,9 @@ QFile::link(const QString &fileName, const QString &linkName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Copies the file currently specified by fileName() to a file called
|
Copies the file named fileName() to \a newName.
|
||||||
\a newName. Returns \c true if successful; otherwise returns \c false.
|
|
||||||
|
|
||||||
Note that if a file with the name \a newName already exists,
|
\include qfile-copy.qdocinc
|
||||||
copy() returns \c false (i.e. QFile will not overwrite it).
|
|
||||||
|
|
||||||
The source file is closed before it is copied.
|
|
||||||
|
|
||||||
\sa setFileName()
|
\sa setFileName()
|
||||||
*/
|
*/
|
||||||
@ -867,11 +863,9 @@ QFile::copy(const QString &newName)
|
|||||||
/*!
|
/*!
|
||||||
\overload
|
\overload
|
||||||
|
|
||||||
Copies the file \a fileName to \a newName. Returns \c true if successful;
|
Copies the file named \a fileName to \a newName.
|
||||||
otherwise returns \c false.
|
|
||||||
|
|
||||||
If a file with the name \a newName already exists, copy() returns \c false
|
\include qfile-copy.qdocinc
|
||||||
(i.e., QFile will not overwrite it).
|
|
||||||
|
|
||||||
\sa rename()
|
\sa rename()
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user