summaryrefslogtreecommitdiffstats
path: root/src/macdeployqt/shared
diff options
context:
space:
mode:
authorSamuel Gaist <samuel.gaist@edeltech.ch>2017-12-30 00:19:53 +0100
committerSamuel Gaist <samuel.gaist@edeltech.ch>2017-12-30 20:29:14 +0000
commit89f588f651b92a81778da1e9ee6c046ce82ae15d (patch)
tree851791e340843a0c96ea6472df1016c2225c533a /src/macdeployqt/shared
parent0372f4aae92fa6012e1684c8143c7c7daa98cb9b (diff)
macdeployqt: refactor plugin handling
Rather than adding new cases per module, use a map that will make it cleaner to associate modules with their corresponding plugins. Change-Id: Ia745066ec394f72d64b4ffe74ece4bbbf48aa2ac Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/macdeployqt/shared')
-rw-r--r--src/macdeployqt/shared/shared.cpp25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/macdeployqt/shared/shared.cpp b/src/macdeployqt/shared/shared.cpp
index 7dafe63aa..5f66dde0c 100644
--- a/src/macdeployqt/shared/shared.cpp
+++ b/src/macdeployqt/shared/shared.cpp
@@ -1079,21 +1079,18 @@ void deployPlugins(const ApplicationBundleInfo &appBundleInfo, const QString &pl
});
}
- // multimedia plugins if QtMultimedia.framework is in use
- if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("QtMultimedia") + libInfixWithFramework)) {
- addPlugins(QStringLiteral("mediaservice"));
- addPlugins(QStringLiteral("audio"));
- }
-
- // render related plugins if Qt3DRender.framework is in use
- if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("Qt3DRender") + libInfixWithFramework)) {
- addPlugins(QStringLiteral("sceneparsers"));
- addPlugins(QStringLiteral("geometryloaders"));
- }
+ static const std::map<QString, std::vector<QString>> map {
+ {QStringLiteral("QtMultimedia"), {QStringLiteral("mediaservice"), QStringLiteral("audio")}},
+ {QStringLiteral("Qt3DRender"), {QStringLiteral("sceneparsers"), QStringLiteral("geometryloaders")}},
+ {QStringLiteral("Qt3DQuickRender"), {QStringLiteral("renderplugins")}}
+ };
- // scene related plugins if Qt3DQuickRender.framework is in use
- if (deploymentInfo.deployedFrameworks.contains(QStringLiteral("Qt3DQuickRender") + libInfixWithFramework)) {
- addPlugins(QStringLiteral("renderplugins"));
+ for (const auto &it : map) {
+ if (deploymentInfo.deployedFrameworks.contains(it.first + libInfixWithFramework)) {
+ for (const auto &pluginType : it.second) {
+ addPlugins(pluginType);
+ }
+ }
}
foreach (const QString &plugin, pluginList) {