iOS: only use image picker dialog as native dialog for loading files

The user cannot use the image picker dialog for selecting file names
for saving. So ensure we fall back to use the normal file dialog
when that is the case.

Change-Id: Ic73571d34d87c47c68b75dfe0bad1810ad91aa57
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
bb10
Richard Moe Gustavsen 2015-03-18 14:04:01 +01:00
parent 32e6a4a976
commit 53a9ff2a45
1 changed files with 3 additions and 1 deletions

View File

@ -95,8 +95,10 @@ bool QIOSFileDialog::show(Qt::WindowFlags windowFlags, Qt::WindowModality window
Q_UNUSED(windowFlags);
Q_UNUSED(windowModality);
bool acceptOpen = options()->acceptMode() == QFileDialogOptions::AcceptOpen;
QString directory = options()->initialDirectory().toLocalFile();
if (directory.startsWith(QLatin1String("assets-library:"))) {
if (acceptOpen && directory.startsWith(QLatin1String("assets-library:"))) {
m_viewController = [[QIOSImagePickerController alloc] initWithQIOSFileDialog:this];
UIWindow *window = parent ? reinterpret_cast<UIView *>(parent->winId()).window
: [UIApplication sharedApplication].keyWindow;