QGenericUnixServices: avoid dbus calls on non xdg envs

Fixes: QTBUG-130884
Pick-to: 6.9 6.8 6.5
Change-Id: I2525293f776676cda63e61c3c5093045dbafcf38
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Liang Qi 2024-11-21 10:56:46 +01:00
parent ff51ea5418
commit 1969b1a90a

View File

@ -373,6 +373,9 @@ private:
QGenericUnixServices::QGenericUnixServices()
{
if (desktopEnvironment() == QByteArrayLiteral("UNKNOWN"))
return;
#if QT_CONFIG(dbus)
if (qEnvironmentVariableIntValue("QT_NO_XDG_DESKTOP_PORTAL") > 0) {
return;