-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathPluginsDeployerFactory.cpp
More file actions
122 lines (104 loc) · 4.69 KB
/
PluginsDeployerFactory.cpp
File metadata and controls
122 lines (104 loc) · 4.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
// local headers
#include "PluginsDeployerFactory.h"
#include "BasicPluginsDeployer.h"
#include "BearerPluginsDeployer.h"
#include "GamepadPluginsDeployer.h"
#include "LocationPluginsDeployer.h"
#include "Multimedia5PluginsDeployer.h"
#include "Multimedia6PluginsDeployer.h"
#include "NetworkInformationPluginsDeployer.h"
#include "PlatformPluginsDeployer.h"
#include "PositioningPluginsDeployer.h"
#include "PrintSupportPluginsDeployer.h"
#include "QmlPluginsDeployer.h"
#include "Qt3DPluginsDeployer.h"
#include "SqlPluginsDeployer.h"
#include "SvgPluginsDeployer.h"
#include "TextToSpeechPluginsDeployer.h"
#include "TlsBackendsDeployer.h"
#include "WaylandcompositorPluginsDeployer.h"
#include "WebEnginePluginsDeployer.h"
#include "XcbglIntegrationPluginsDeployer.h"
using namespace linuxdeploy::plugin::qt;
using namespace linuxdeploy::core::appdir;
namespace fs = std::filesystem;
PluginsDeployerFactory::PluginsDeployerFactory(AppDir& appDir,
fs::path qtPluginsPath,
fs::path qtLibexecsPath,
fs::path qtInstallQmlPath,
fs::path qtTranslationsPath,
fs::path qtDataPath,
int qtMajorVersion,
int qtMinorVersion) : appDir(appDir),
qtPluginsPath(std::move(qtPluginsPath)),
qtLibexecsPath(std::move(qtLibexecsPath)),
qtInstallQmlPath(std::move(qtInstallQmlPath)),
qtTranslationsPath(std::move(qtTranslationsPath)),
qtDataPath(std::move(qtDataPath)),
qtMajorVersion(qtMajorVersion),
qtMinorVersion(qtMinorVersion) {}
std::vector<std::shared_ptr<PluginsDeployer>> PluginsDeployerFactory::getDeployers(const std::string& moduleName) {
if (moduleName == "gui") {
return {getInstance<PlatformPluginsDeployer>(moduleName), getInstance<XcbglIntegrationPluginsDeployer>(moduleName)};
}
if (moduleName == "opengl" || moduleName == "xcbqpa") {
return {getInstance<XcbglIntegrationPluginsDeployer>(moduleName)};
}
if (moduleName == "network") {
if (qtMajorVersion < 6) {
return {getInstance<BearerPluginsDeployer>(moduleName)};
} else {
std::vector<std::shared_ptr<PluginsDeployer>> deployers;
if (qtMinorVersion >= 1) {
deployers.push_back(
getInstance<NetworkInformationPluginsDeployer>(moduleName));
}
if (qtMinorVersion >= 2) {
deployers.push_back(getInstance<TlsBackendsDeployer>(moduleName));
}
return deployers;
}
}
if (moduleName == "svg") {
return {getInstance<SvgPluginsDeployer>(moduleName)};
}
if (moduleName == "sql") {
return {getInstance<SqlPluginsDeployer>(moduleName)};
}
if (moduleName == "location") {
return {getInstance<LocationPluginsDeployer>(moduleName)};
}
if (moduleName == "positioning") {
return {getInstance<PositioningPluginsDeployer>(moduleName)};
}
if (moduleName == "multimedia") {
if (qtMajorVersion < 6) {
return {getInstance<Multimedia5PluginsDeployer>(moduleName)};
} else {
return {getInstance<Multimedia6PluginsDeployer>(moduleName)};
}
}
if (moduleName == "webenginecore") {
return {getInstance<WebEnginePluginsDeployer>(moduleName)};
}
if (moduleName == "qml") {
return {getInstance<QmlPluginsDeployer>(moduleName)};
}
if (moduleName == "3dquickrender" || moduleName == "3drender") {
return {getInstance<Qt3DPluginsDeployer>(moduleName)};
}
if (moduleName == "gamepad") {
return {getInstance<GamepadPluginsDeployer>(moduleName)};
}
if (moduleName == "printsupport") {
return {getInstance<PrintSupportPluginsDeployer>(moduleName)};
}
if (moduleName == "texttospeech") {
return {getInstance<TextToSpeechPluginsDeployer>(moduleName)};
}
if (moduleName == "waylandcompositor") {
return {getInstance<WaylandcompositorPluginsDeployer>(moduleName)};
}
// fallback
return {getInstance<BasicPluginsDeployer>(moduleName)};
}