summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm30
1 files changed, 6 insertions, 24 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 9bc7df02fb..8c3b5fd5c6 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -672,36 +672,18 @@ bool QCocoaFileDialogHelper::hideCocoaFilePanel()
}
}
-void QCocoaFileDialogHelper::platformNativeDialogModalHelp()
+void QCocoaFileDialogHelper::exec_sys()
{
- // Do a queued meta-call to open the native modal dialog so it opens after the new
- // event loop has started to execute (in QDialog::exec). Using a timer rather than
- // a queued meta call is intentional to ensure that the call is only delivered when
- // [NSApp run] runs (timers are handeled special in cocoa). If NSApp is not
- // running (which is the case if e.g a top-most QEventLoop has been
- // interrupted, and the second-most event loop has not yet been reactivated (regardless
- // if [NSApp run] is still on the stack)), showing a native modal dialog will fail.
- QTimer::singleShot(1, this, SIGNAL(launchNativeAppModalPanel()));
-}
-
-void QCocoaFileDialogHelper::_q_platformRunNativeAppModalPanel()
-{
- // TODO:
-#if 0
- QBoolBlocker nativeDialogOnTop(QApplicationPrivate::native_modal_dialog_active);
-#endif
+ // Note: If NSApp is not running (which is the case if e.g a top-most
+ // QEventLoop has been interrupted, and the second-most event loop has not
+ // yet been reactivated (regardless if [NSApp run] is still on the stack)),
+ // showing a native modal dialog will fail.
QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
- [delegate runApplicationModalPanel];
- if (dialogResultCode_sys() == QPlatformDialogHelper::Accepted)
+ if ([delegate runApplicationModalPanel])
emit accept();
else
emit reject();
-}
-QPlatformDialogHelper::DialogCode QCocoaFileDialogHelper::dialogResultCode_sys()
-{
- QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *delegate = static_cast<QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *>(mDelegate);
- return [delegate dialogResultCode];
}
bool QCocoaFileDialogHelper::defaultNameFilterDisables() const