diff -r 56cd8111b7f7 -r 41300fa6a67c src/gui/kernel/qcocoaapplicationdelegate_mac.mm --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm Tue Jan 26 12:42:25 2010 +0200 +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm Tue Feb 02 00:43:10 2010 +0200 @@ -83,6 +83,7 @@ #include #include #include +#include #include QT_BEGIN_NAMESPACE @@ -177,6 +178,9 @@ return [[qtMenuLoader retain] autorelease]; } +// This function will only be called when NSApp is actually running. Before +// that, the kAEQuitApplication apple event will be sendt to +// QApplicationPrivate::globalAppleEventProcessor in qapplication_mac.mm - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { Q_UNUSED(sender); @@ -303,5 +307,15 @@ [self doesNotRecognizeSelector:invocationSelector]; } +- (void)getUrl:(NSAppleEventDescriptor *)event withReplyEvent:(NSAppleEventDescriptor *)replyEvent +{ + Q_UNUSED(replyEvent); + + NSString *urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue]; + QUrl url(qt_mac_NSStringToQString(urlString)); + QFileOpenEvent qtEvent(url); + qt_sendSpontaneousEvent(qAppInstance(), &qtEvent); +} + @end #endif