diff options
| author | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2023-06-13 12:52:28 +0200 |
|---|---|---|
| committer | Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> | 2023-06-20 15:41:20 +0200 |
| commit | 666ce51d4eb6b5dd312f98e2d7a18c54b59945e4 (patch) | |
| tree | d0e16835bf644e3cbace5ec7cc7743ff679f521c /src/corelib/plugin/qpluginloader.cpp | |
| parent | a12abc2614cf69be676436af99eb62363fdaff3d (diff) | |
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>
Diffstat (limited to 'src/corelib/plugin/qpluginloader.cpp')
| -rw-r--r-- | src/corelib/plugin/qpluginloader.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp index c6341199c9c..812ee58825d 100644 --- a/src/corelib/plugin/qpluginloader.cpp +++ b/src/corelib/plugin/qpluginloader.cpp @@ -349,10 +349,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 |
