From 358fd91951f26cbb552daaf9d28c49429302b6ab Mon Sep 17 00:00:00 2001 From: Christoph Schleifenbaum Date: Thu, 5 Apr 2012 16:31:40 +0200 Subject: Make QFileOpenEvents delivered again. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create a FileOpenEvent within QWindowSystemInterfacePrivate and handle it in QWindowSystemSystemInterface and QGuiApplication Change-Id: Ie777c923958d83d56e8648c9bfb1f9dcb985654d Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm') diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index 947d91005d..ec086fe62c 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -80,6 +80,8 @@ #include #include #include +#include "qt_mac_p.h" +#include QT_USE_NAMESPACE @@ -217,7 +219,7 @@ static void cleanupCocoaApplicationDelegate() { Q_UNUSED(filenames); Q_UNUSED(sender); -/* + for (NSString *fileName in filenames) { QString qtFileName = QCFString::toQString(fileName); if (inLaunch) { @@ -228,14 +230,13 @@ static void cleanupCocoaApplicationDelegate() if (qApp->arguments().contains(qtFileName)) continue; } - QFileOpenEvent foe(qtFileName); - qt_sendSpontaneousEvent(qAppInstance(), &foe); + QWindowSystemInterface::handleFileOpenEvent(qtFileName); } if (reflectionDelegate && [reflectionDelegate respondsToSelector:@selector(application:openFiles:)]) [reflectionDelegate application:sender openFiles:filenames]; -*/ + } - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender -- cgit v1.2.3