Fix potential wrong-over-optimization in math utilities
[carla.git] / data / patches / qt59-osx10.8-compat2.patch
blob5eb8e5c69f7e45b0368bf227d9f10093ad32f079
1 diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
2 index aa61245..2423378 100644
3 --- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
4 +++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
5 @@ -78,7 +78,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
6 mHelper = 0;
7 mStolenContentView = 0;
8 mPanelButtons = nil;
9 - mResultCode = NSModalResponseCancel;
10 + mResultCode = NSCancelButton;
11 mDialogIsExecuting = false;
12 mResultSet = false;
13 mClosingDueToKnownButton = false;
14 @@ -166,7 +166,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
15 mClosingDueToKnownButton = true;
16 [mColorPanel close];
17 [self updateQtColor];
18 - [self finishOffWithCode:NSModalResponseOK];
19 + [self finishOffWithCode:NSOKButton];
22 - (void)onCancelClicked
23 @@ -175,7 +175,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
24 mClosingDueToKnownButton = true;
25 [mColorPanel close];
26 mQtColor = QColor();
27 - [self finishOffWithCode:NSModalResponseCancel];
28 + [self finishOffWithCode:NSCancelButton];
32 @@ -236,12 +236,12 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
34 [NSApp runModalForWindow:mColorPanel];
35 mDialogIsExecuting = false;
36 - return (mResultCode == NSModalResponseOK);
37 + return (mResultCode == NSOKButton);
40 - (QPlatformDialogHelper::DialogCode)dialogResultCode
42 - return (mResultCode == NSModalResponseOK) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
43 + return (mResultCode == NSOKButton) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
46 - (BOOL)windowShouldClose:(id)window
47 @@ -250,7 +250,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
48 if (!mPanelButtons)
49 [self updateQtColor];
50 if (mDialogIsExecuting) {
51 - [self finishOffWithCode:NSModalResponseCancel];
52 + [self finishOffWithCode:NSCancelButton];
53 } else {
54 mResultSet = true;
55 if (mHelper)
56 @@ -276,7 +276,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
57 // This check will prevent any such recursion.
58 if (!mResultSet) {
59 mResultSet = true;
60 - if (mResultCode == NSModalResponseCancel) {
61 + if (mResultCode == NSCancelButton) {
62 emit mHelper->reject();
63 } else {
64 emit mHelper->accept();
65 diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
66 index b22f1b1..d2dd645 100644
67 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
68 +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm
69 @@ -401,7 +401,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
70 // [NSApp run], which is the normal code path for cocoa applications.
71 if (NSModalSession session = d->currentModalSession()) {
72 QBoolBlocker execGuard(d->currentExecIsNSAppRun, false);
73 - while ([NSApp runModalSession:session] == NSModalResponseContinue && !d->interrupt) {
74 + while ([NSApp runModalSession:session] == NSRunContinuesResponse && !d->interrupt) {
75 qt_mac_waitForMoreEvents(NSModalPanelRunLoopMode);
76 if (session != d->currentModalSessionCached) {
77 // It's possible to release the current modal session
78 @@ -445,7 +445,7 @@ bool QCocoaEventDispatcher::processEvents(QEventLoop::ProcessEventsFlags flags)
79 if (flags & QEventLoop::WaitForMoreEvents)
80 qt_mac_waitForMoreEvents(NSModalPanelRunLoopMode);
81 NSInteger status = [NSApp runModalSession:session];
82 - if (status != NSModalResponseContinue && session == d->currentModalSessionCached) {
83 + if (status != NSRunContinuesResponse && session == d->currentModalSessionCached) {
84 // INVARIANT: Someone called [NSApp stopModal:] from outside the event
85 // dispatcher (e.g to stop a native dialog). But that call wrongly stopped
86 // 'session' as well. As a result, we need to restart all internal sessions:
87 diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
88 index 9a96895..b227794 100644
89 --- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
90 +++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
91 @@ -104,7 +104,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
92 mHelper = 0;
93 mStolenContentView = 0;
94 mPanelButtons = 0;
95 - mResultCode = NSModalResponseCancel;
96 + mResultCode = NSCancelButton;
97 mDialogIsExecuting = false;
98 mResultSet = false;
100 @@ -169,7 +169,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
101 - (void)onOkClicked
103 [mFontPanel close];
104 - [self finishOffWithCode:NSModalResponseOK];
105 + [self finishOffWithCode:NSOKButton];
108 - (void)onCancelClicked
109 @@ -177,7 +177,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
110 if (mPanelButtons) {
111 [mFontPanel close];
112 mQtFont = QFont();
113 - [self finishOffWithCode:NSModalResponseCancel];
114 + [self finishOffWithCode:NSCancelButton];
118 @@ -222,12 +222,12 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
120 [NSApp runModalForWindow:mFontPanel];
121 mDialogIsExecuting = false;
122 - return (mResultCode == NSModalResponseOK);
123 + return (mResultCode == NSOKButton);
126 - (QPlatformDialogHelper::DialogCode)dialogResultCode
128 - return (mResultCode == NSModalResponseOK) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
129 + return (mResultCode == NSOKButton) ? QPlatformDialogHelper::Accepted : QPlatformDialogHelper::Rejected;
132 - (BOOL)windowShouldClose:(id)window
133 @@ -236,7 +236,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
134 if (!mPanelButtons)
135 [self updateQtFont];
136 if (mDialogIsExecuting) {
137 - [self finishOffWithCode:NSModalResponseCancel];
138 + [self finishOffWithCode:NSCancelButton];
139 } else {
140 mResultSet = true;
141 if (mHelper)
142 @@ -262,7 +262,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSFontPanelDelegate);
143 // This check will prevent any such recursion.
144 if (!mResultSet) {
145 mResultSet = true;
146 - if (mResultCode == NSModalResponseCancel) {
147 + if (mResultCode == NSCancelButton) {
148 emit mHelper->reject();
149 } else {
150 emit mHelper->accept();
151 diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
152 index 191553e..e6abf49 100644
153 --- a/src/plugins/platforms/cocoa/qcocoawindow.h
154 +++ b/src/plugins/platforms/cocoa/qcocoawindow.h
155 @@ -217,7 +217,9 @@ public:
156 Q_NOTIFICATION_HANDLER(NSWindowDidExitFullScreenNotification) void windowDidExitFullScreen();
157 Q_NOTIFICATION_HANDLER(NSWindowDidOrderOffScreenNotification) void windowDidOrderOffScreen();
158 Q_NOTIFICATION_HANDLER(NSWindowDidOrderOnScreenAndFinishAnimatingNotification) void windowDidOrderOnScreen();
159 +#if 0
160 Q_NOTIFICATION_HANDLER(NSWindowDidChangeOcclusionStateNotification) void windowDidChangeOcclusionState();
161 +#endif
162 Q_NOTIFICATION_HANDLER(NSWindowDidChangeScreenNotification) void windowDidChangeScreen();
163 Q_NOTIFICATION_HANDLER(NSWindowWillCloseNotification) void windowWillClose();
165 diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
166 index c7aa579..56eb291 100644
167 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm
168 +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
169 @@ -1532,6 +1532,7 @@ void QCocoaWindow::windowDidOrderOnScreen()
170 exposeWindow();
173 +#if 0
174 void QCocoaWindow::windowDidChangeOcclusionState()
176 // Several unit tests expect paint and/or expose events for windows that are
177 @@ -1547,6 +1548,7 @@ void QCocoaWindow::windowDidChangeOcclusionState()
181 +#endif
183 void QCocoaWindow::windowDidChangeScreen()
185 diff --git a/src/printsupport/dialogs/qpagesetupdialog_mac.mm b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
186 index 1e39845..9305566 100644
187 --- a/src/printsupport/dialogs/qpagesetupdialog_mac.mm
188 +++ b/src/printsupport/dialogs/qpagesetupdialog_mac.mm
189 @@ -77,7 +77,7 @@ QT_USE_NAMESPACE
190 QPageSetupDialog *dialog = static_cast<QPageSetupDialog *>(contextInfo);
191 QPrinter *printer = dialog->printer();
193 - if (returnCode == NSModalResponseOK) {
194 + if (returnCode == NSOKButton) {
195 PMPageFormat format = static_cast<PMPageFormat>([printInfo PMPageFormat]);
196 PMRect paperRect;
197 PMGetUnadjustedPaperRect(format, &paperRect);
198 @@ -88,7 +88,7 @@ QT_USE_NAMESPACE
199 printer->printEngine()->setProperty(QPrintEngine::PPK_Orientation, orientation == kPMLandscape ? QPrinter::Landscape : QPrinter::Portrait);
202 - dialog->done((returnCode == NSModalResponseOK) ? QDialog::Accepted : QDialog::Rejected);
203 + dialog->done((returnCode == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);
205 @end
207 diff --git a/src/printsupport/dialogs/qprintdialog_mac.mm b/src/printsupport/dialogs/qprintdialog_mac.mm
208 index 8547799..f7bbb59 100644
209 --- a/src/printsupport/dialogs/qprintdialog_mac.mm
210 +++ b/src/printsupport/dialogs/qprintdialog_mac.mm
211 @@ -101,7 +101,7 @@ QT_USE_NAMESPACE
212 QPrintDialog *dialog = static_cast<QPrintDialog *>(contextInfo);
213 QPrinter *printer = dialog->printer();
215 - if (returnCode == NSModalResponseOK) {
216 + if (returnCode == NSOKButton) {
217 PMPrintSession session = static_cast<PMPrintSession>([printInfo PMPrintSession]);
218 PMPrintSettings settings = static_cast<PMPrintSettings>([printInfo PMPrintSettings]);
220 @@ -190,7 +190,7 @@ QT_USE_NAMESPACE
221 printer->setPageSize(pageSize);
222 printer->setOrientation(orientation == kPMLandscape ? QPrinter::Landscape : QPrinter::Portrait);
224 - dialog->done((returnCode == NSModalResponseOK) ? QDialog::Accepted : QDialog::Rejected);
225 + dialog->done((returnCode == NSOKButton) ? QDialog::Accepted : QDialog::Rejected);
227 @end
229 diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
230 index 4c5c9e1..5b4a95e 100644
231 --- a/src/testlib/qtestcase.cpp
232 +++ b/src/testlib/qtestcase.cpp
233 @@ -147,6 +147,7 @@ static bool debuggerPresent()
234 return CFStringCompare(str1, str2, kCFCompareCaseInsensitive) == kCFCompareEqualTo;
237 +#if 0
238 // Check if there is an exception handler for the process:
239 mach_msg_type_number_t portCount = 0;
240 exception_mask_t masks[EXC_TYPES_COUNT];
241 @@ -163,6 +164,7 @@ static bool debuggerPresent()
245 +#endif
247 // Ok, no debugger attached. So, let's see if CrashReporter will throw up a dialog. If so, we
248 // leave it to the OS to do the stack trace.