From 37e021edd485e1f81a0859481da72ba676f4099a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pinkava?= Date: Thu, 10 Oct 2024 23:19:02 +0200 Subject: [PATCH] Gui: add Qt Platform name to splashscreen information dump There is several bugs in FreeCAD which are related to platform (mostly wayland), the hope is this will make it easier to identify the dependence of bug on the platform --- src/Gui/Splashscreen.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 7fe02a5c21..398ea5f8f4 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -819,13 +819,20 @@ void AboutDialog::copyToClipboard() QString deskEnv = QProcessEnvironment::systemEnvironment().value(QStringLiteral("XDG_CURRENT_DESKTOP"), QString()); QString deskSess = QProcessEnvironment::systemEnvironment().value(QStringLiteral("DESKTOP_SESSION"), QString()); + QStringList deskInfoList; QString deskInfo; - if ( !(deskEnv.isEmpty() && deskSess.isEmpty()) ) { - if ( deskEnv.isEmpty() || deskSess.isEmpty() ) - deskInfo = QLatin1String(" (") + deskEnv + deskSess + QLatin1String(")"); - else - deskInfo = QLatin1String(" (") + deskEnv + QLatin1String("/") + deskSess + QLatin1String(")"); + if (!deskEnv.isEmpty()) { + deskInfoList.append(deskEnv); + } + if (!deskSess.isEmpty()) { + deskInfoList.append(deskSess); + } + if (qGuiApp->platformName() != QLatin1String("windows") && qGuiApp->platformName() != QLatin1String("cocoa")) { + deskInfoList.append(qGuiApp->platformName()); + } + if(!deskInfoList.isEmpty()) { + deskInfo = QLatin1String(" (") + deskInfoList.join(QLatin1String("/")) + QLatin1String(")"); } str << "OS: " << prettyProductInfoWrapper() << deskInfo << '\n';