@@ -13,47 +13,39 @@ using namespace linuxdeploy::core::log;
13
13
14
14
namespace fs = std::filesystem;
15
15
16
- bool PlatformPluginsDeployer::deploy () {
17
- // calling the default code is optional, but it won't hurt for now
18
- if (!BasicPluginsDeployer::deploy ())
19
- return false ;
20
-
16
+ bool PlatformPluginsDeployer::customDeploy ()
17
+ {
21
18
ldLog () << " Deploying platform plugins" << std::endl;
22
19
23
20
// always deploy default platform
24
- if (!appDir.deployLibrary (qtPluginsPath / " platforms/libqxcb.so" , appDir.path () / " usr/plugins/platforms/" ))
21
+ if (!appDir.deployLibrary (qtPluginsPath / " platforms/libqxcb.so" ,
22
+ appDir.path () / " usr/plugins/platforms/" ))
25
23
return false ;
26
24
27
25
// deploy extra platform plugins, if any
28
- const auto * const platformPluginsFromEnvData = getenv (" EXTRA_PLATFORM_PLUGINS" );
26
+ const auto * const platformPluginsFromEnvData = getenv (" EXTRA_PLATFORM_PLUGINS" );
29
27
if (platformPluginsFromEnvData != nullptr ) {
30
- for (const auto & platformToDeploy : linuxdeploy::util::split (std::string (platformPluginsFromEnvData), ' ;' )) {
28
+ for (const auto &platformToDeploy :
29
+ linuxdeploy::util::split (std::string (platformPluginsFromEnvData), ' ;' )) {
31
30
ldLog () << " Deploying extra platform plugin: " << platformToDeploy << std::endl;
32
- if (!appDir.deployLibrary (qtPluginsPath / " platforms" / platformToDeploy, appDir.path () / " usr/plugins/platforms/" ))
31
+ if (!appDir.deployLibrary (qtPluginsPath / " platforms" / platformToDeploy,
32
+ appDir.path () / " usr/plugins/platforms/" ))
33
33
return false ;
34
34
}
35
- }
36
-
37
- for (fs::directory_iterator i (qtPluginsPath / " platforminputcontexts" ); i != fs::directory_iterator (); ++i) {
38
- if (!appDir.deployLibrary (*i, appDir.path () / " usr/plugins/platforminputcontexts/" ))
39
- return false ;
40
35
}
41
36
42
- for (fs::directory_iterator i (qtPluginsPath / " imageformats" ); i != fs::directory_iterator (); ++i) {
43
- if (!appDir.deployLibrary (*i, appDir.path () / " usr/plugins/imageformats/" ))
44
- return false ;
45
- }
46
-
47
- // TODO: platform themes -- https://github.com/probonopd/linuxdeployqt/issues/236
37
+ // TODO: platform themes --
38
+ // https://github.com/probonopd/linuxdeployqt/issues/236
48
39
49
40
const fs::path platformThemesPath = qtPluginsPath / " platformthemes" ;
50
- const fs::path stylesPath = qtPluginsPath / " styles" ;
41
+ const fs::path stylesPath = qtPluginsPath / " styles" ;
51
42
52
43
const fs::path platformThemesDestination = appDir.path () / " usr/plugins/platformthemes/" ;
53
- const fs::path stylesDestination = appDir.path () / " usr/plugins/styles/" ;
44
+ const fs::path stylesDestination = appDir.path () / " usr/plugins/styles/" ;
54
45
55
46
if (getenv (" DEPLOY_PLATFORM_THEMES" ) != nullptr ) {
56
- ldLog () << LD_WARNING << " Deploying all platform themes and styles [experimental feature]" << std::endl;
47
+ ldLog () << LD_WARNING << " Deploying all platform themes and styles [experimental feature]"
48
+ << std::endl;
57
49
58
50
if (fs::is_directory (platformThemesPath))
59
51
for (fs::directory_iterator i (platformThemesPath); i != fs::directory_iterator (); ++i)
@@ -70,15 +62,23 @@ bool PlatformPluginsDeployer::deploy() {
70
62
const auto libqxdgPath = platformThemesPath / " libqxdgdesktopportal.so" ;
71
63
72
64
for (const auto &file : {libqxdgPath}) {
73
- // we need to check whether the files exist at least, otherwise the deferred deployment operation fails
65
+ // we need to check whether the files exist at least, otherwise the
66
+ // deferred deployment operation fails
74
67
if (fs::is_regular_file (file)) {
75
- ldLog () << " Attempting to deploy" << file.filename () << " found at path" << file.parent_path () << std::endl;
68
+ ldLog () << " Attempting to deploy" << file.filename () << " found at path"
69
+ << file.parent_path () << std::endl;
76
70
appDir.deployFile (file, platformThemesDestination);
77
71
} else {
78
- ldLog () << " Could not find" << file.filename () << " on system, skipping deployment" << std::endl;
72
+ ldLog () << " Could not find" << file.filename () << " on system, skipping deployment"
73
+ << std::endl;
79
74
}
80
75
}
81
76
}
82
77
83
78
return true ;
84
79
}
80
+
81
+ std::vector<std::string> PlatformPluginsDeployer::qtPluginsToBeDeployed () const
82
+ {
83
+ return {" platforminputcontexts" , " imageformats" };
84
+ }
0 commit comments