diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-11-03 22:25:11 -0700 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-11-06 04:13:44 +0000 |
commit | 6be30397b31dafacaffef5040348e3cd724272de (patch) | |
tree | 4b070ab0d009194fcccf1e5d83f87d7a246acf66 /src | |
parent | 13117d44950afc6c7d1ef342d86bac55b99137b8 (diff) |
QCoreApplication: document the app's bindir is in libraryPaths()
The QCoreApplicationPrivate::appendApplicationPathToLibraryPaths()
function has been there since at least Qt 4.5.1, so the documentation
for appendLibraryPaths() hasn't matched behavior for a minimum of 13
years. The documentation for libraryPaths() has mentioned this fact,
though.
Searching the application's bin dir is normal on Windows, as many
application packages are a flat install with the .exe and all .dlls in
one dir. I find it questionable to do so on Unix, though: any and all
applications expecting to be installed by a Linux distribution would not
install plugins to /usr/bin, whereas on macOS bundles have their own
organization anyway.
But I'm not prepared to change the behavior without more justification.
I can think only of broken configurations (such what is described in
QTBUG-97950 where a combination of bad decisions led to scanning all of
/usr/bin) and running an executable that is stored in a world-writable
directory.
Task-number: QTBUG-97950
Change-Id: Ice04365c72984d07a64dfffd16b440868373d7a5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 4fe71db2ee0db2eab3d1927a1904635a3d26970f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 3bce669ba1..61bc795a23 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -2804,10 +2804,11 @@ void QCoreApplication::setLibraryPaths(const QStringList &paths) it is searched for libraries first. If \a path is empty or already in the path list, the path list is not changed. - The default path list consists of a single entry, the installation - directory for plugins. The default installation directory for plugins - is \c INSTALL/plugins, where \c INSTALL is the directory where Qt was - installed. + The default path list consists of one or two entries. The first is the + installation directory for plugins, which is \c INSTALL/plugins, where \c + INSTALL is the directory where Qt was installed. The second is the + application's own directory (\b not the current directory), but only after + the QCoreApplication object is instantiated. The library paths are reset to the default when an instance of QCoreApplication is destructed. |