KLibexec
Functions | |
QStringList | kdeFrameworksPaths (const QString &relativePath) |
QString | path (const QString &relativePath) |
Detailed Description
Utility functions around libexec.
Function Documentation
◆ kdeFrameworksPaths()
|
inline |
default paths list for KDE Frameworks
This function returns a fairly opinionated list of paths you can feed into QStandardPaths. The list includes various standard locations for Qt and KDE Frameworks and should generally be sensible for most use cases. You may wish to append the absolute installation path as final fallback.
- Warning
- The precise content and order of the list is an implementation detail and not expected to remain stable!
- Parameters
-
relativePath see path() - not all paths get this appended!
- Returns
- QStringList list of search paths
- Since
- 5.91
Definition at line 68 of file klibexec.h.
◆ path()
Absolute libexec path resolved in relative relation to the current shared object.
This function helps locate the absolute libexec path relative to the caller's binary artifact.
For example:
- Your source gets built with prefix /usr
- Your binary artifact's presumed absolute path will be
/usr/lib/libfoobar.so
- You call
KLibexec::path("libexec/foobar")
Scenario 1 - The binaries are actually installed in /usr:
- The function's output is
/usr/lib/libexec/foobar/
(resolved relatively from/usr/lib/libfoobar.so
)
Scenario 2 - The same binaries are installed in /opt (or moved there):
- The function's output is
/opt/lib/libexec/foobar/
(resolved relatively from/opt/lib/libfoobar.so
)
- Parameters
-
relativePath relative element to append (e.g. "libexec/foobar" resulting in /usr/lib/libexec/foobar/ as output) when called with an empty string you effectively get the directory of your binary artifact.
- Returns
- QString absolute libexec path or empty string if it cannot be resolved
- Since
- 5.91
Definition at line 48 of file klibexec.h.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:22 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.