From 0c7bea06c4871d25ebd334512cf1c38879b4b547 Mon Sep 17 00:00:00 2001 From: Juha Vuolle Date: Thu, 6 Mar 2025 15:16:20 +0200 Subject: [PATCH] Allow unhandled custom uri-scheme opens to create QFileInfoEvent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On macOS custom uri-scheme opens may generate a QFileOpenEvent that the applications can handle. However when adding support also for QDesktopServices::setUrlHandler(), this delivery mechanism stopped from working because the event was unconditionally consumed / delivered to only the url handler. Instead change the logic such that if the url handler does not handle it, allow a QFileInfoEvent to be created. Amends: 664c7ffb212eb898ed03f7b19c883400fa027b6b Fixes: QTBUG-134316 Pick-to: 6.9.0 6.8 6.8.3 Change-Id: Ib1ed371ef531586bf549cf473b2a54748584d91d Reviewed-by: Tor Arne Vestbø (cherry picked from commit 4755f52c08aac424b18ad94404ca8f7dabf8220d) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index f652e66a55a..e6087fcf576 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -343,8 +343,8 @@ QT_USE_NAMESPACE return; QCocoaIntegration *cocoaIntegration = QCocoaIntegration::instance(); Q_ASSERT(cocoaIntegration); - cocoaIntegration->services()->handleUrl(QUrl(qurlString)); - return; + if (cocoaIntegration->services()->handleUrl(QUrl(qurlString))) + return; } // The string we get from the requesting application might not necessarily meet