diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-17 22:00:08 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-01-23 18:49:15 +0000 |
commit | 7c69f6171ddc76d22e4f6e433be69c5cf365db8f (patch) | |
tree | 3834934b38b0ccdc054b43ac2b9c6eedf64ecce8 /src/corelib/io/qfile.cpp | |
parent | 5eab68bbee6c9633f0702c87c05e119ec4d910e0 (diff) |
QFile/QFileInfo: mark readLink() as deprecated
QFile/QFileInfo::readLink() functions are obsolete but were not marked
as deprecated.
Explicit mark them as deprecated so they can be removed with Qt6.
Change-Id: I52424dc5441e1f5b01015713df990bbec5186caa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Diffstat (limited to 'src/corelib/io/qfile.cpp')
-rw-r--r-- | src/corelib/io/qfile.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index d3f846bc1d..ef97d67653 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -454,7 +454,13 @@ QFile::exists(const QString &fileName) \sa fileName(), setFileName() */ +QString QFile::symLinkTarget() const +{ + Q_D(const QFile); + return d->engine()->fileName(QAbstractFileEngine::LinkName); +} +#if QT_DEPRECATED_SINCE(5, 13) /*! \obsolete @@ -463,9 +469,9 @@ QFile::exists(const QString &fileName) QString QFile::readLink() const { - Q_D(const QFile); - return d->engine()->fileName(QAbstractFileEngine::LinkName); + return symLinkTarget(); } +#endif /*! \fn static QString QFile::symLinkTarget(const QString &fileName) @@ -478,7 +484,12 @@ QFile::readLink() const This name may not represent an existing file; it is only a string. QFile::exists() returns \c true if the symlink points to an existing file. */ +QString QFile::symLinkTarget(const QString &fileName) +{ + return QFileInfo(fileName).symLinkTarget(); +} +#if QT_DEPRECATED_SINCE(5, 13) /*! \obsolete @@ -487,8 +498,9 @@ QFile::readLink() const QString QFile::readLink(const QString &fileName) { - return QFileInfo(fileName).readLink(); + return symLinkTarget(fileName); } +#endif /*! Removes the file specified by fileName(). Returns \c true if successful; |