diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 5c5a796278..0333f62870 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -623,29 +623,6 @@ bool QResource::isValid() const \sa isDir() */ -#if QT_DEPRECATED_SINCE(5, 13) -/*! - \obsolete - - Returns \c true if the resource represents a file and the data backing it - is in a compressed format, false otherwise. If the data is compressed, - check compressionAlgorithm() to verify what algorithm to use to decompress - the data. - - \note This function is deprecated and can be replaced with - \code - compressionAlgorithm() != NoCompression - \endcode - - \sa data(), compressionAlgorithm(), isFile() -*/ - -bool QResource::isCompressed() const -{ - return compressionAlgorithm() != NoCompression; -} -#endif - /*! \since 5.13 @@ -797,50 +774,6 @@ QStringList QResource::children() const return d->children; } -#if QT_DEPRECATED_SINCE(5, 13) -/*! - \obsolete - - Use QDir::addSearchPath() with a prefix instead. - - Adds \a path to the search paths searched in to find resources that are - not specified with an absolute path. The \a path must be an absolute - path (start with \c{/}). - - The default search path is to search only in the root (\c{:/}). The last - path added will be consulted first upon next QResource creation. -*/ -void -QResource::addSearchPath(const QString &path) -{ - if (!path.startsWith(QLatin1Char('/'))) { - qWarning("QResource::addResourceSearchPath: Search paths must be absolute (start with /) [%ls]", - qUtf16Printable(path)); - return; - } - const auto locker = qt_scoped_lock(resourceMutex()); - resourceSearchPaths()->prepend(path); -} - -/*! - \obsolete - - Use QDir::searchPaths() instead. - - Returns the current search path list. This list is consulted when - creating a relative resource. - - \sa QDir::addSearchPath(), QDir::setSearchPaths() -*/ - -QStringList -QResource::searchPaths() -{ - const auto locker = qt_scoped_lock(resourceMutex()); - return *resourceSearchPaths(); -} -#endif - inline uint QResourceRoot::hash(int node) const { if(!node) //root diff --git a/src/corelib/io/qresource.h b/src/corelib/io/qresource.h index 52b0d74d29..8f17c1f075 100644 --- a/src/corelib/io/qresource.h +++ b/src/corelib/io/qresource.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2019 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -80,17 +80,6 @@ public: QByteArray uncompressedData() const; QDateTime lastModified() const; -#if QT_DEPRECATED_SINCE(5, 13) - QT_DEPRECATED_X("Use QDir::addSearchPath() instead") - static void addSearchPath(const QString &path); - QT_DEPRECATED_X("Use QDir::searchPaths() instead") - static QStringList searchPaths(); -#endif -#if QT_DEPRECATED_SINCE(5, 15) - QT_DEPRECATED_VERSION_X_5_15("Use QResource::compressionAlgorithm() instead") - bool isCompressed() const; -#endif - static bool registerResource(const QString &rccFilename, const QString &resourceRoot=QString()); static bool unregisterResource(const QString &rccFilename, const QString &resourceRoot=QString()); diff --git a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp index 2accf99c9a..519b95e745 100644 --- a/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp +++ b/tests/auto/corelib/io/qresourceengine/tst_qresourceengine.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Copyright (C) 2019 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -57,10 +57,6 @@ private slots: void checkStructure(); void searchPath_data(); void searchPath(); -#if QT_DEPRECATED_SINCE(5, 13) - void searchPath_deprecated_data(); - void searchPath_deprecated(); -#endif void doubleSlashInRoot(); void setLocale(); void lastModified(); @@ -540,48 +536,6 @@ void tst_QResourceEngine::searchPath() qf.close(); } -#if QT_DEPRECATED_SINCE(5, 13) - -void tst_QResourceEngine::searchPath_deprecated_data() -{ - QTest::addColumn("searchPath"); - QTest::addColumn("file"); - QTest::addColumn("expected"); - - QTest::newRow("no_search_path") << QString() - << ":search_file.txt" - << QByteArray("root\n"); - QTest::newRow("path1") << "/searchpath1" - << ":search_file.txt" - << QByteArray("path1\n"); - QTest::newRow("no_search_path2") << QString() - << ":/search_file.txt" - << QByteArray("root\n"); - QTest::newRow("path2") << "/searchpath2" - << ":search_file.txt" - << QByteArray("path2\n"); -} - -void tst_QResourceEngine::searchPath_deprecated() -{ - QFETCH(QString, searchPath); - QFETCH(QString, file); - QFETCH(QByteArray, expected); - - if(!searchPath.isEmpty()) - QDir::addResourceSearchPath(searchPath); - QFile qf(file); - QVERIFY(qf.open(QFile::ReadOnly)); - QByteArray actual = qf.readAll(); - - actual.replace('\r', ""); - - QCOMPARE(actual, expected); - qf.close(); -} - -#endif - void tst_QResourceEngine::checkUnregisterResource_data() { QTest::addColumn("rcc_file");