Cocoa: respect QT_NO_EXCEPTION in color dialog
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>
Thu, 24 Mar 2011 09:41:36 +0000 (10:41 +0100)
committerOlivier Goffart <olivier.goffart@nokia.com>
Tue, 10 May 2011 10:54:43 +0000 (12:54 +0200)
If the macro is set, we should not use cocoa exceptions either, as
this causes compile failures

Rev-By: jbache
(cherry picked from commit cdb5729d8e1ffc4a00b52d6d4bbee34a9820a193)

src/gui/dialogs/qcolordialog_mac.mm

index ee9b19a..9daf595 100644 (file)
@@ -343,6 +343,7 @@ QT_USE_NAMESPACE
     mDialogIsExecuting = true;
     bool modalEnded = false;
     while (!modalEnded) {
+#ifndef QT_NO_EXCEPTIONS
         @try {
             [NSApp runModalForWindow:mColorPanel];
             modalEnded = true;
@@ -351,6 +352,10 @@ QT_USE_NAMESPACE
             // clicking on 'SelectedMenuItemColor' from the 'Developer'
             // palette (tab three).
         }
+#else
+        [NSApp runModalForWindow:mColorPanel];
+        modalEnded = true;
+#endif
     }
 
     QAbstractEventDispatcher::instance()->interrupt();