From dafa7cc7b5bc35f06f63a78b8f29a7d71fc93f5d Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 10 Oct 2016 20:34:54 +0200 Subject: QFileDialog: add missing break statements in switch in labelText() It is of course wrong to potentially return the text of the Cancel button if the text of the Accept role button was asked for. Found independently by GCC 7 and Coverity. Coverity-Id: 11150 Change-Id: Ie30f7875daee16a78eeff4b314ce17cbd7cd3aa8 Reviewed-by: Edward Welbourne --- src/widgets/dialogs/qfiledialog.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/widgets/dialogs/qfiledialog.cpp') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 3aa9052917..61f5f7b0d2 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2042,10 +2042,12 @@ QString QFileDialog::labelText(DialogLabel label) const button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Save); if (button) return button->text(); + break; case Reject: button = d->qFileDialogUi->buttonBox->button(QDialogButtonBox::Cancel); if (button) return button->text(); + break; } return QString(); } -- cgit v1.2.3 From 78ee77f49122ac525590715a0a034965e3e59adf Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 4 Oct 2016 15:04:04 +0200 Subject: iOS: link photo lib plugin based on Info.plist contents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the application's Info.plist contains the key 'NSPhotoLibraryUsageDescription', we know that we can safely link in qiosnsphotolibrarysupport without violating AppStore requirements. This is a simple feature that doesn't introduce additional qmake API for doing app deployment with optional iOS QPA plugins. [ChangeLog][iOS] Starting from iOS 10, Apple requires all apps that need access to photos to have the key 'NSPhotoLibraryUsageDescription' in the Info.plist. Therefore, to get the same support in Qt (when, e.g., using a file dialog), the Info.plist assigned to QMAKE_INFO_PLIST will need this key as well. Change-Id: I7a93afe24b589cad96d5a1d9e2a155ad1671178a Reviewed-by: Tor Arne Vestbø Reviewed-by: Jake Petroules --- src/widgets/dialogs/qfiledialog.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/widgets/dialogs/qfiledialog.cpp') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 61f5f7b0d2..f8e4299397 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -896,6 +896,9 @@ void QFileDialogPrivate::_q_goToUrl(const QUrl &url) {QStandardPaths::standardLocations(QStandardPaths::PicturesLocation).last()}, a native image picker dialog will be used for accessing the user's photo album. The filename returned can be loaded using QFile and related APIs. + For this to be enabled, the Info.plist assigned to QMAKE_INFO_PLIST in the + project file must contain the key \c NSPhotoLibraryUsageDescription. See + Info.plist documentation from Apple for more information regarding this key. This feature was added in Qt 5.5. */ void QFileDialog::setDirectory(const QString &directory) -- cgit v1.2.3