From cdca8a5af3dfd1a56c2c070f8b9b25717168324f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20Str=C3=B8mme?= <christian.stromme@qt.io>
Date: Thu, 25 Jan 2018 11:43:55 +0100
Subject: [PATCH] macdeployqt: Handle deployment of QtWebView's plugins
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This change makes sure that the plugins are deployed correctly

Change-Id: Ia967525bcbdf97f86385b68e5a4039f5b5f8ee20
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
---
 src/macdeployqt/shared/shared.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index a2284a192..977e7c4c3 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -1079,6 +1079,20 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
         });
     }
 
+    // WebView plugins if QtWebView.framework is in use
+    if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtWebView") + libInfixWithFramework)) {
+        addPlugins(QStringLiteral("webview"), [](const QString &lib) {
+            if (lib.startsWith(QStringLiteral("libqtwebview_webengine"))) {
+                LogWarning() << "Plugin" << lib << "uses QtWebEngine and is not Mac App store compliant.";
+                if (appstoreCompliant) {
+                    LogWarning() << "Skip plugin" << lib;
+                    return false;
+                }
+            }
+            return true;
+        });
+    }
+
     static const std::map<QString, std::vector<QString>> map {
         {QStringLiteral("QtMultimedia"), {QStringLiteral("mediaservice"), QStringLiteral("audio")}},
         {QStringLiteral("Qt3DRender"), {QStringLiteral("sceneparsers"), QStringLiteral("geometryloaders")}},
-- 
GitLab