KLibexec Namespace Reference


QStringList kdeFrameworksPaths (const QString &relativePath)
QString path (const QString &relativePath)

Detailed Description

Utility functions around libexec.

Function Documentation

◆ kdeFrameworksPaths()

QStringList KLibexec::kdeFrameworksPaths ( const QString & relativePath)

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.

The precise content and order of the list is an implementation detail and not expected to remain stable!
relativePathsee path() - not all paths get this appended!
QStringList list of search paths

Definition at line 68 of file klibexec.h.

◆ path()

QString KLibexec::path ( const QString & relativePath)

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)
relativePathrelative 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.
QString absolute libexec path or empty string if it cannot be resolved

Definition at line 48 of file klibexec.h.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sun Feb 25 2024 18:38:40 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.