Merge pull request #262042 from K900/qt5-20231019

qt5: update to latest upstream patchset
This commit is contained in:
K900
2023-10-19 19:24:38 +03:00
committed by GitHub
3 changed files with 4 additions and 84 deletions
@@ -46,7 +46,6 @@ let
./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
./qtbase.patch.d/0010-qtbase-assert.patch
./qtbase.patch.d/0011-fix-header_module.patch
./qtbase.patch.d/9999-backport-dbus-crash.patch
];
qtdeclarative = [
./qtdeclarative.patch
@@ -1,79 +0,0 @@
commit eb0c6846a5d05d686f0686f0f1ddddcad762ad26 (HEAD -> kde/5.15)
Author: K900 <me@0upti.me>
Date: Mon Aug 14 22:44:02 2023 +0300
QLibraryPrivate: Actually merge load hints
Or old and new load hints in mergeLoadHints() instead of just storing
new ones. Andjust QLibraryPrivate::setLoadHints() to handle objects
with no file name differently and just set load hints directly.
Mention that load hints are merged once the file name is set
in the documentation for QLibrary::setLoadHints().
Add a regression test into tst_qfactoryloader.
Update and extend tst_QPluginLoader::loadHints() to take into account
load hints merging.
Fixes: QTBUG-114480
Change-Id: I3b9afaec7acde1f5ff992d913f8d7217392c7e00
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 5d2f024267..45b5a3fe27 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -526,7 +526,7 @@ void QLibraryPrivate::mergeLoadHints(QLibrary::LoadHints lh)
if (pHnd.loadRelaxed())
return;
- loadHintsInt.storeRelaxed(lh);
+ loadHintsInt.fetchAndOrRelaxed(lh);
}
QFunctionPointer QLibraryPrivate::resolve(const char *symbol)
@@ -538,6 +538,13 @@ QFunctionPointer QLibraryPrivate::resolve(const char *symbol)
void QLibraryPrivate::setLoadHints(QLibrary::LoadHints lh)
{
+ // Set the load hints directly for a dummy if this object is not associated
+ // with a file. Such object is not shared between multiple instances.
+ if (fileName.isEmpty()) {
+ loadHintsInt.storeRelaxed(lh);
+ return;
+ }
+
// this locks a global mutex
QMutexLocker lock(&qt_library_mutex);
mergeLoadHints(lh);
@@ -1166,6 +1173,10 @@ QString QLibrary::errorString() const
lazy symbol resolution, and will not export external symbols for resolution
in other dynamically-loaded libraries.
+ \note Hints can only be cleared when this object is not associated with a
+ file. Hints can only be added once the file name is set (\a hints will
+ be or'ed with the old hints).
+
\note Setting this property after the library has been loaded has no effect
and loadHints() will not reflect those changes.
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 0a63b93762..ceee5d6385 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -414,10 +414,11 @@ QString QPluginLoader::errorString() const
void QPluginLoader::setLoadHints(QLibrary::LoadHints loadHints)
{
if (!d) {
- d = QLibraryPrivate::findOrCreate(QString()); // ugly, but we need a d-ptr
+ d = QLibraryPrivate::findOrCreate({}, {}, loadHints); // ugly, but we need a d-ptr
d->errorString.clear();
+ } else {
+ d->setLoadHints(loadHints);
}
- d->setLoadHints(loadHints);
}
QLibrary::LoadHints QPluginLoader::loadHints() const
@@ -16,8 +16,8 @@
},
"qtbase": {
"url": "https://invent.kde.org/qt/qt/qtbase.git",
"rev": "c672f8bffff5af90a40bad7e621eae4616b12a31",
"sha256": "1sp3igzxmh110zs27inq1mqm17ayxljhc3gpjk1cyyzbc92hhcz2"
"rev": "ea7a183732c17005f08ca14fd70cdd305c90396d",
"sha256": "0lblir4zcnxc2ix9frcsygkhfs5qx7xibpflapmi6d978jjfxjmx"
},
"qtcharts": {
"url": "https://invent.kde.org/qt/qt/qtcharts.git",
@@ -61,8 +61,8 @@
},
"qtlocation": {
"url": "https://invent.kde.org/qt/qt/qtlocation.git",
"rev": "b4c42e255ee0f04eec4cf5cde35398f3c303ddb9",
"sha256": "18d1y0pcx0a98f7129g5sv2m0rmxw031jb68kg60c9c0mk3whpq0"
"rev": "48a17e88fc1df5b6ae82a9787466226c830bcbf2",
"sha256": "0gn4zsf01xr0g8divixk2zpq97dnqs1cdc3q577ijczd2rcs6z4f"
},
"qtlottie": {
"url": "https://invent.kde.org/qt/qt/qtlottie.git",