File indexing completed on 2024-05-05 16:07:08

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 KDBUSADDONS_UPDATELAUNCHENVIRONMENTJOB_H
0009 #define KDBUSADDONS_UPDATELAUNCHENVIRONMENTJOB_H
0010 
0011 #include <kdbusaddons_export.h>
0012 
0013 #include <QProcessEnvironment>
0014 
0015 #include <memory>
0016 
0017 class QString;
0018 class UpdateLaunchEnvironmentJobPrivate;
0019 
0020 /**
0021  * @class UpdateLaunchEnvironmentJob updatelaunchenvironmentjob.h <UpdateLaunchEnvironmentJob>
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  *  - KInit (deprecated)
0032  *
0033  * Environment variables are sanitized before uploading.
0034  *
0035  * This object deletes itself after completion, similar to KJobs
0036  *
0037  * @since 5.84
0038  */
0039 class KDBUSADDONS_EXPORT UpdateLaunchEnvironmentJob : public QObject
0040 {
0041     Q_OBJECT
0042 
0043 public:
0044     explicit UpdateLaunchEnvironmentJob(const QProcessEnvironment &environment);
0045     ~UpdateLaunchEnvironmentJob() override;
0046 
0047 Q_SIGNALS:
0048     void finished();
0049 
0050 private:
0051     KDBUSADDONS_NO_EXPORT void start();
0052 
0053 private:
0054     std::unique_ptr<UpdateLaunchEnvironmentJobPrivate> const d;
0055 };
0056 
0057 #endif