diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2021-11-03 22:25:11 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2021-11-05 21:13:34 -0700 |
commit | 4fe71db2ee0db2eab3d1927a1904635a3d26970f (patch) | |
tree | e6cc041a605f0cff3f70f914a28ac3f7e03c1935 /src/corelib/kernel | |
parent | 1d62bf3150b4457a325b75e88783a746b1277a8e (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
Pick-to: 6.2
Change-Id: Ice04365c72984d07a64dfffd16b440868373d7a5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-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 e3530a3393..ff23623e9a 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -2837,10 +2837,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. |