diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2022-06-13 11:37:31 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-02-03 18:02:12 +0100 |
commit | ccac52d84b9b7c6525f08341142eb34a1740b7fe (patch) | |
tree | bd098297a0e1ceb64b7fc9ebf70acbc8d8029789 | |
parent | eee2e481725368e28a733bc122a30fb20bd2604e (diff) |
Remove QResourceGlobalData::resourceSearchPaths
The means to add entries to this QStringList were deprecated in 5.13
and removed in Qt 6, so the list is always empty and the one place
that still references it only needs to check the empty path it adds to
the list.
Resolve conflict caused by the shift from QLatin1String() to ""_L1.
Change-Id: Ie1b3f13b33c04458bd03a4a1e3db0e33a76e89f6
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 21cb05bef7e852480975b92026e196c3fbf24228)
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r-- | src/corelib/io/qresource.cpp | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp index 3c285497e3..9f4d652bcd 100644 --- a/src/corelib/io/qresource.cpp +++ b/src/corelib/io/qresource.cpp @@ -201,7 +201,6 @@ struct QResourceGlobalData { QRecursiveMutex resourceMutex; ResourceList resourceList; - QStringList resourceSearchPaths; }; Q_GLOBAL_STATIC(QResourceGlobalData, resourceGlobalData) @@ -211,9 +210,6 @@ static inline QRecursiveMutex &resourceMutex() static inline ResourceList *resourceList() { return &resourceGlobalData->resourceList; } -static inline QStringList *resourceSearchPaths() -{ return &resourceGlobalData->resourceSearchPaths; } - /*! \class QResource \inmodule QtCore @@ -394,16 +390,10 @@ void QResourcePrivate::ensureInitialized() const if (path.startsWith(QLatin1Char('/'))) { that->load(path.toString()); } else { - const auto locker = qt_scoped_lock(resourceMutex()); - QStringList searchPaths = *resourceSearchPaths(); - searchPaths << QLatin1String(""); - for (int i = 0; i < searchPaths.size(); ++i) { - const QString searchPath(searchPaths.at(i) + QLatin1Char('/') + path); - if (that->load(searchPath)) { - that->absoluteFilePath = QLatin1Char(':') + searchPath; - break; - } - } + // Should we search QDir::searchPath() before falling back to root ? + const QString searchPath(u'/' + path); + if (that->load(searchPath)) + that->absoluteFilePath = u':' + searchPath; } } |