From 34d87abfd8409159441371017b87ddbe1f989c4a Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Sat, 10 Dec 2022 09:01:48 +0200 Subject: [PATCH] kinit: new method for dumping the system environment Signed-off-by: Ivailo Monev --- kinit/klauncher_adaptor.cpp | 9 ++++++++- kinit/klauncher_adaptor.h | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/kinit/klauncher_adaptor.cpp b/kinit/klauncher_adaptor.cpp index 524e53f3..be60c394 100644 --- a/kinit/klauncher_adaptor.cpp +++ b/kinit/klauncher_adaptor.cpp @@ -198,7 +198,7 @@ int KLauncherAdaptor::kdeinit_exec_with_workdir(const QString &app, const QStrin } process->setProcessEnvironment(processenv); process->setWorkingDirectory(workdir); - kDebug() << "starting" << appexe << args << env << processenv.toStringList(); + kDebug() << "starting" << appexe << args << env; // either start_service_by_desktop_path() or this method send ASN if (!startup_id.isEmpty()) { Q_ASSERT(m_kstartupinfoid.none() == true); @@ -359,6 +359,13 @@ int KLauncherAdaptor::start_service_by_desktop_path(const QString &serviceName, return result; } +#ifdef KLAUNCHER_DEBUG +QStringList KLauncherAdaptor::environment() const +{ + return m_environment.toStringList(); +} +#endif + void KLauncherAdaptor::slotProcessStateChanged(QProcess::ProcessState state) { QProcess* process = qobject_cast(sender()); diff --git a/kinit/klauncher_adaptor.h b/kinit/klauncher_adaptor.h index 3748884a..6de900e0 100644 --- a/kinit/klauncher_adaptor.h +++ b/kinit/klauncher_adaptor.h @@ -26,6 +26,8 @@ #include #include +// #define KLAUNCHER_DEBUG + // Adaptor class for interface org.kde.KLauncher class KLauncherAdaptor: public QDBusAbstractAdaptor { @@ -60,6 +62,11 @@ public Q_SLOTS: int start_service_by_desktop_name(const QString &serviceName, const QStringList &urls, const QStringList &envs, const QString &startup_id, bool blind, const QDBusMessage &msg, QString &dbusServiceName, QString &error, qint64 &pid); int start_service_by_desktop_path(const QString &serviceName, const QStringList &urls, const QStringList &envs, const QString &startup_id, bool blind, const QDBusMessage &msg, QString &dbusServiceName, QString &error, qint64 &pid); + // for debugging +#ifdef KLAUNCHER_DEBUG + QStringList environment() const; +#endif + Q_SIGNALS: void autoStart0Done(); void autoStart1Done();