From aad0ab897f61bcb6ac9ba908afd1ee33e05fe4db Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 11 Feb 2025 08:34:29 -0800 Subject: [PATCH] QDesktopServices: don't use openDocument if the URL has a query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ChangeLog][QtGui][QDesktopServices] Fixed a bug that caused QDesktopServices::openUrl() to discard a query when opening a local file URL that contained a query but no fragment. Pick-to: 6.9 6.8 Fixes: QTBUG-133663 Change-Id: Ie8fa190036417f590540fffdcf03e53f3c99b38f Reviewed-by: Tor Arne Vestbø --- src/gui/util/qdesktopservices.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/util/qdesktopservices.cpp b/src/gui/util/qdesktopservices.cpp index 7ca138b1b7d..6f0e42ed57e 100644 --- a/src/gui/util/qdesktopservices.cpp +++ b/src/gui/util/qdesktopservices.cpp @@ -177,9 +177,9 @@ bool QDesktopServices::openUrl(const QUrl &url) qWarning("The platform plugin does not support services."); return false; } - // We only use openDocument if there is no fragment for the URL to + // We only use openDocument if there is no fragment or query for the URL to // avoid it being lost when using openDocument - if (url.isLocalFile() && !url.hasFragment()) + if (url.isLocalFile() && !url.hasFragment() && !url.hasQuery()) return platformServices->openDocument(url); return platformServices->openUrl(url); }