KSandbox Namespace

Utility functions for use inside application sandboxes such as flatpak or snap. More...

Header: #include <KSandbox>
CMake: find_package(KF6 REQUIRED COMPONENTS CoreAddons)
target_link_libraries(mytarget PRIVATE KF6::CoreAddons)
Since: 5.95

Functions

bool isFlatpak()
bool isInside()
bool isSnap()
(since 5.97) KSandbox::ProcessContext makeHostContext(const QProcess &process)
(since 5.97) void startHostProcess(QProcess &process, QIODeviceBase::OpenMode mode = QProcess::ReadWrite)

Detailed Description

Function Documentation

bool KSandbox::isFlatpak()

Returns whether the application is inside a flatpak sandbox

bool KSandbox::isInside()

Returns whether the application is inside one of the supported sandboxes

bool KSandbox::isSnap()

Returns whether the application is inside a snap sandbox

[since 5.97] KSandbox::ProcessContext KSandbox::makeHostContext(const QProcess &process)

Returns the actual program and arguments for running the QProcess on the host (e.g. a flatpak-spawn-wrapped argument list)

This function was introduced in 5.97.

[since 5.97] void KSandbox::startHostProcess(QProcess &process, QIODeviceBase::OpenMode mode = QProcess::ReadWrite)

Starts the QProcess on the host (if the current context is inside a sandbox, otherwise it simply runs QProcess::start)

This function was introduced in 5.97.