1 | /* |
2 | SPDX-FileCopyrightText: 2020 Kai Uwe Broulik <kde@broulik.de> |
3 | SPDX-FileCopyrightText: 2021 David Edmundson <davidedmundson@kde.org> |
4 | |
5 | SPDX-License-Identifier: LGPL-2.0-or-later |
6 | */ |
7 | |
8 | #ifndef KUPDATELAUNCHENVIRONMENTJOB_H |
9 | #define KUPDATELAUNCHENVIRONMENTJOB_H |
10 | |
11 | #include <kdbusaddons_export.h> |
12 | |
13 | #include <QProcessEnvironment> |
14 | |
15 | #include <memory> |
16 | |
17 | class QString; |
18 | class KUpdateLaunchEnvironmentJobPrivate; |
19 | |
20 | /** |
21 | * @class KUpdateLaunchEnvironmentJob updatelaunchenvironmentjob.h <KUpdateLaunchEnvironmentJob> |
22 | * |
23 | * Job for updating the launch environment. |
24 | * |
25 | * This job adds or updates an environment variable in process environment that will be used |
26 | * when a process is launched: |
27 | * This includes: |
28 | * - DBus activation |
29 | * - Systemd units |
30 | * - Plasma-session |
31 | * |
32 | * Environment variables are sanitized before uploading. |
33 | * |
34 | * This object deletes itself after completion, similar to KJobs |
35 | * |
36 | * Porting from KF5 to KF6: |
37 | * |
38 | * The class UpdateLaunchEnvironmentJob was renamed to KUpdateLaunchEnvironmentJob. |
39 | * |
40 | * @since 6.0 |
41 | */ |
42 | class KDBUSADDONS_EXPORT KUpdateLaunchEnvironmentJob : public QObject |
43 | { |
44 | Q_OBJECT |
45 | |
46 | public: |
47 | explicit KUpdateLaunchEnvironmentJob(const QProcessEnvironment &environment); |
48 | ~KUpdateLaunchEnvironmentJob() override; |
49 | |
50 | Q_SIGNALS: |
51 | void finished(); |
52 | |
53 | private: |
54 | KDBUSADDONS_NO_EXPORT void start(); |
55 | |
56 | private: |
57 | std::unique_ptr<KUpdateLaunchEnvironmentJobPrivate> const d; |
58 | }; |
59 | |
60 | #endif |
61 | |