Pages
API Documentation
On this page

KUpdateLaunchEnvironmentJob Class

Job for updating the launch environment. This class was introduced in Qt 6.0. More...

  • Header: #include <KUpdateLaunchEnvironmentJob>
  • Since: Qt 6.0
  • CMake: find_package(KF6 REQUIRED COMPONENTS DBusAddons)
    target_link_libraries(mytarget PRIVATE KF6::DBusAddons)
  • Inherits: QObject

List of all members, including inherited members

Public Functions

Signals

Detailed Description

This job adds or updates an environment variable in process environment that will be used when a process is launched. This includes:

  • DBus activation
  • Systemd units
  • Plasma-session

Environment variables are sanitized before uploading.

This object deletes itself after completion, similar to KJobs.

Example usage:

QProcessEnvironment newEnv;
newEnv.insert("VARIABLE"_s, "value"_s);
auto job = new KUpdateLaunchEnvironmentJob(newEnv);
QObject::connect(job, &KUpdateLaunchEnvironmentJob::finished, &SomeClass, &SomeClass::someSlot);

Porting from KF5 to KF6:

The class UpdateLaunchEnvironmentJob was renamed to KUpdateLaunchEnvironmentJob.

Member Function Documentation

[explicit] KUpdateLaunchEnvironmentJob::KUpdateLaunchEnvironmentJob(const QProcessEnvironment &environment)

Creates a new job for the given launch environment.

[signal] void KUpdateLaunchEnvironmentJob::finished()

Emitted when the job is finished, before the object is automatically deleted.

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.