QFileInfo: purge deprecated API

Since 5.10: created()
Since 5.13: readLink()

Change-Id: I9722f81750dd92315a67a1c38df41a95ae63e0db
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
bb10
Edward Welbourne 2020-07-16 14:21:53 +02:00
parent 4ef723c82d
commit fe6a1d34dc
3 changed files with 1 additions and 55 deletions

View File

@ -1194,7 +1194,6 @@ bool QFileInfo::isRoot() const
}
/*!
\fn QString QFileInfo::symLinkTarget() const
\since 4.2
Returns the absolute path to the file or directory a symbolic link
@ -1207,19 +1206,6 @@ bool QFileInfo::isRoot() const
\sa exists(), isSymLink(), isDir(), isFile()
*/
#if QT_DEPRECATED_SINCE(5, 13)
/*!
\obsolete
Use symLinkTarget() instead.
*/
QString QFileInfo::readLink() const
{
return symLinkTarget();
}
#endif
QString QFileInfo::symLinkTarget() const
{
Q_D(const QFileInfo);
@ -1390,32 +1376,6 @@ qint64 QFileInfo::size() const
});
}
#if QT_DEPRECATED_SINCE(5, 10)
/*!
\deprecated
Returns the date and time when the file was created, the time its metadata
was last changed or the time of last modification, whichever one of the
three is available (in that order).
This function is deprecated. Instead, use the birthTime() function to get
the time the file was created, metadataChangeTime() to get the time its
metadata was last changed, or lastModified() to get the time it was last modified.
If the file is a symlink, the time of the target file is returned
(not the symlink).
\sa birthTime(), metadataChangeTime(), lastModified(), lastRead()
*/
QDateTime QFileInfo::created() const
{
QDateTime d = fileTime(QFile::FileBirthTime);
if (d.isValid())
return d;
return fileTime(QFile::FileMetadataChangeTime);
}
#endif
/*!
\since 5.10
Returns the date and time when the file was created / born.

View File

@ -151,10 +151,6 @@ public:
bool isRoot() const;
bool isBundle() const;
#if QT_DEPRECATED_SINCE(5, 13)
QT_DEPRECATED_X("Use QFileInfo::symLinkTarget() instead")
QString readLink() const;
#endif
QString symLinkTarget() const;
#if QT_CONFIG(cxx17_filesystem)
std::filesystem::path filesystemSymLinkTarget() const
@ -172,10 +168,6 @@ public:
qint64 size() const;
// ### Qt6: inline these functions
#if QT_DEPRECATED_SINCE(5, 10)
QT_DEPRECATED_X("Use either birthTime() or metadataChangeTime()")
QDateTime created() const;
#endif
QDateTime birthTime() const;
QDateTime metadataChangeTime() const;
QDateTime lastModified() const;

View File

@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
@ -1035,9 +1035,6 @@ void tst_QFileInfo::systemFiles()
QCOMPARE(fi.metadataChangeTime(), fi.lastModified()); // On Windows, they're the same
QVERIFY(fi.birthTime().isValid());
QVERIFY(fi.birthTime() <= fi.lastModified());
#if QT_DEPRECATED_SINCE(5, 10)
QCOMPARE(fi.created(), fi.birthTime()); // On Windows, they're the same
#endif
}
void tst_QFileInfo::compare_data()
@ -2209,9 +2206,6 @@ static void stateCheck(const QFileInfo &info, const QString &dirname, const QStr
QCOMPARE(info.permissions(), QFile::Permissions());
#if QT_DEPRECATED_SINCE(5, 10)
QVERIFY(!info.created().isValid());
#endif
QVERIFY(!info.birthTime().isValid());
QVERIFY(!info.metadataChangeTime().isValid());
QVERIFY(!info.lastRead().isValid());