diff options
author | Fabien Freling <fabien.freling@nokia.com> | 2010-03-05 13:15:54 (GMT) |
---|---|---|
committer | Fabien Freling <fabien.freling@nokia.com> | 2010-03-05 13:15:54 (GMT) |
commit | 12308db7663679e42c87aa72c564ec3f9f1a457f (patch) | |
tree | 45fe8da8216443980f8d33b05a61adec66f391d7 /src | |
parent | 4070bb1daafafabebb3c893a472a22fab413e4de (diff) | |
download | Qt-12308db7663679e42c87aa72c564ec3f9f1a457f.zip Qt-12308db7663679e42c87aa72c564ec3f9f1a457f.tar.gz Qt-12308db7663679e42c87aa72c564ec3f9f1a457f.tar.bz2 |
Change behavior of applicationShouldTerminate.
We now terminate the application as long as Qt
says we can. If not, then we cancel the
termination.
Task-number: QTBUG-6296
Reviewed-by: Morten Sorvig
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qcocoaapplicationdelegate_mac.mm | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm index ab71a05..5dcf613 100644 --- a/src/gui/kernel/qcocoaapplicationdelegate_mac.mm +++ b/src/gui/kernel/qcocoaapplicationdelegate_mac.mm @@ -179,7 +179,7 @@ static void cleanupCocoaApplicationDelegate() } // This function will only be called when NSApp is actually running. Before -// that, the kAEQuitApplication apple event will be sendt to +// that, the kAEQuitApplication Apple event will be sent to // QApplicationPrivate::globalAppleEventProcessor in qapplication_mac.mm - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender { @@ -196,21 +196,18 @@ static void cleanupCocoaApplicationDelegate() qAppInstance()->quit(); startedQuit = false; } + return NSTerminateNow; } if (qtPrivate->threadData->eventLoops.size() == 0) { // INVARIANT: No event loop is executing. This probably // means that Qt is used as a plugin, or as a part of a native - // Cocoa application. In any case it should be fine to + // Cocoa application. In any case it should be fine to // terminate now: return NSTerminateNow; - } else { - // Prevent Cocoa from terminating the application, since this simply - // exits the program whithout allowing QApplication::exec() to return. - // The call to QApplication::quit() above will instead quit the - // application from the Qt side. - return NSTerminateCancel; } + + return NSTerminateCancel; } - (void)applicationDidFinishLaunching:(NSNotification *)aNotification |