diff options
author | Fabien Freling <fabien.freling@nokia.com> | 2010-03-05 13:15:54 (GMT) |
---|---|---|
committer | Samuli Piippo <samuli.piippo@digia.com> | 2011-06-09 10:05:02 (GMT) |
commit | abf262548a6ced48858c8f1460c88ce923eab405 (patch) | |
tree | 7e25717beb118bdd627e0f2344265e7401d7859a | |
parent | bc7749e5d9624afabe808daadf2da1069492f69f (diff) | |
download | Qt-abf262548a6ced48858c8f1460c88ce923eab405.zip Qt-abf262548a6ced48858c8f1460c88ce923eab405.tar.gz Qt-abf262548a6ced48858c8f1460c88ce923eab405.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(cherry picked from commit 12308db7663679e42c87aa72c564ec3f9f1a457f)
-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 dc1b9c5..ca54885 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 |