summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/ios/qiosservices.mm
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-05 18:52:38 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-05 18:52:38 +0100
commitf6dbdd9c16166f345fd5743886229192c97c2c4f (patch)
tree05e5e7b806dd627be4e3ba6fc9a32f115847acb0 /src/plugins/platforms/ios/qiosservices.mm
parentb8084618545570a8832d344a2e9586e1226cc697 (diff)
parent47efa9213d92a4366e03bd6d056837cd5bbadb1e (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/sql/drivers/sqlite/qsql_sqlite.cpp Change-Id: Ia7cffd2c99ae3d5eea6b5740683c06e921336dcd
Diffstat (limited to 'src/plugins/platforms/ios/qiosservices.mm')
-rw-r--r--src/plugins/platforms/ios/qiosservices.mm19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/platforms/ios/qiosservices.mm b/src/plugins/platforms/ios/qiosservices.mm
index 32203aeb71..0ac6c590ca 100644
--- a/src/plugins/platforms/ios/qiosservices.mm
+++ b/src/plugins/platforms/ios/qiosservices.mm
@@ -42,6 +42,7 @@
#include "qiosservices.h"
#include <QtCore/qurl.h>
+#include <QtGui/qdesktopservices.h>
#import <UIKit/UIApplication.h>
@@ -49,6 +50,9 @@ QT_BEGIN_NAMESPACE
bool QIOSServices::openUrl(const QUrl &url)
{
+ if (url == m_handlingUrl)
+ return false;
+
if (url.scheme().isEmpty())
return openDocument(url);
@@ -66,4 +70,19 @@ bool QIOSServices::openDocument(const QUrl &url)
return QPlatformServices::openDocument(url);
}
+/* Callback from iOS that the application should handle a URL */
+bool QIOSServices::handleUrl(const QUrl &url)
+{
+ QUrl previouslyHandling = m_handlingUrl;
+ m_handlingUrl = url;
+
+ // FIXME: Add platform services callback from QDesktopServices::setUrlHandler
+ // so that we can warn the user if calling setUrlHandler without also setting
+ // up the matching keys in the Info.plist file (CFBundleURLTypes and friends).
+ bool couldHandle = QDesktopServices::openUrl(url);
+
+ m_handlingUrl = previouslyHandling;
+ return couldHandle;
+}
+
QT_END_NAMESPACE