File indexing completed on 2024-04-28 03:53:58

0001 /*
0002     SPDX-FileCopyrightText: 2020 Kai Uwe Broulik <kde@broulik.de>
0003     SPDX-FileCopyrightText: 2021 David Edmundson <davidedmundson@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.0-or-later
0006 */
0007 
0008 #ifndef KUPDATELAUNCHENVIRONMENTJOB_H
0009 #define KUPDATELAUNCHENVIRONMENTJOB_H
0010 
0011 #include <kdbusaddons_export.h>
0012 
0013 #include <QProcessEnvironment>
0014 
0015 #include <memory>
0016 
0017 class QString;
0018 class KUpdateLaunchEnvironmentJobPrivate;
0019 
0020 /**
0021  * @class KUpdateLaunchEnvironmentJob updatelaunchenvironmentjob.h <KUpdateLaunchEnvironmentJob>
0022  *
0023  * Job for updating the launch environment.
0024  *
0025  * This job adds or updates an environment variable in process environment that will be used
0026  * when a process is launched:
0027  * This includes:
0028  *  - DBus activation
0029  *  - Systemd units
0030  *  - Plasma-session
0031  *
0032  * Environment variables are sanitized before uploading.
0033  *
0034  * This object deletes itself after completion, similar to KJobs
0035  *
0036  * Porting from KF5 to KF6:
0037  *
0038  * The class UpdateLaunchEnvironmentJob was renamed to KUpdateLaunchEnvironmentJob.
0039  *
0040  * @since 6.0
0041  */
0042 class KDBUSADDONS_EXPORT KUpdateLaunchEnvironmentJob : public QObject
0043 {
0044     Q_OBJECT
0045 
0046 public:
0047     explicit KUpdateLaunchEnvironmentJob(const QProcessEnvironment &environment);
0048     ~KUpdateLaunchEnvironmentJob() override;
0049 
0050 Q_SIGNALS:
0051     void finished();
0052 
0053 private:
0054     KDBUSADDONS_NO_EXPORT void start();
0055 
0056 private:
0057     std::unique_ptr<KUpdateLaunchEnvironmentJobPrivate> const d;
0058 };
0059 
0060 #endif