From b4af1235eff3c7b23fdc5534453a45aa3db70e5e Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 15 Sep 2014 19:41:42 +0200 Subject: [PATCH] OS X: File dialog does not show "Media" section. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This bug can be reproduced (AFAIK) only on 10.9. To fix it I suggest we create NSOpenPanel/NSSavePanel _every_ time it must be displayed. Actually, that's what I've seen in all code samples I was able to found - nobody tries to retain this panel and re-use it. If we re-use it, "Media" section magically disappears. I believe this bug is not Qt's bug, but something weird in Cocoa. Task-number: QTBUG-40655 Change-Id: Ic0e76e0a9a5444a76f336d511c0ff93f9fd05797 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm index 2b7b8109ad..a47b28700c 100644 --- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm +++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm @@ -712,9 +712,8 @@ bool QCocoaFileDialogHelper::show(Qt::WindowFlags windowFlags, Qt::WindowModalit void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate() { - if (mDelegate) - return; QCocoaAutoReleasePool pool; + const SharedPointerFileDialogOptions &opts = options(); const QList selectedFiles = opts->initiallySelectedFiles(); const QUrl directory = mDir.isEmpty() ? opts->initialDirectory() : mDir; @@ -726,6 +725,7 @@ void QCocoaFileDialogHelper::createNSOpenSavePanelDelegate() options:opts helper:this]; + [static_cast(mDelegate) release]; mDelegate = delegate; }