Skip to content

Commit b195c7c

Browse files
committed
Deploy Qt plugins with default deployStandardQtPlugins() function
1 parent 245d0bd commit b195c7c

36 files changed

+65
-108
lines changed

src/deployers/BasicPluginsDeployer.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,23 @@ BasicPluginsDeployer::BasicPluginsDeployer(std::string moduleName,
2929
qtDataPath(std::move(qtDataPath)) {}
3030

3131
bool BasicPluginsDeployer::deploy() {
32-
for (const auto &pluginName : qtPluginsToBeDeployed()) {
33-
ldLog() << "Deploying" << pluginName << "plugins" << std::endl;
32+
// currently this is a no-op, but we might add more functionality later on, such as some kinds of default
33+
// attempts to copy data based on the moduleName
34+
return doDeploy();
35+
}
36+
37+
bool BasicPluginsDeployer::deployStandardQtPlugins(const std::vector<std::string>& plugins)
38+
{
39+
for (const auto &pluginName : plugins) {
40+
ldLog() << "Deploying Qt" << pluginName << "plugins" << std::endl;
3441
for (fs::directory_iterator i(qtPluginsPath / pluginName); i != fs::directory_iterator(); ++i) {
3542
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins" / pluginName))
3643
return false;
3744
}
3845
}
39-
40-
return customDeploy();
41-
}
42-
43-
bool BasicPluginsDeployer::customDeploy() {
4446
return true;
4547
}
4648

47-
std::vector<std::string> BasicPluginsDeployer::qtPluginsToBeDeployed() const {
48-
return {};
49+
bool BasicPluginsDeployer::doDeploy() {
50+
return true;
4951
}

src/deployers/BasicPluginsDeployer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ namespace linuxdeploy {
6161
* name and path scheme, but some modules are special so
6262
* they should write custom deployment code.
6363
*/
64-
virtual bool customDeploy();
64+
virtual bool doDeploy();
6565

6666
/**
6767
* Returns a list of Qt plugin names that should be deployed and
6868
* follow the default name and path scheme.
6969
*/
70-
virtual std::vector<std::string> qtPluginsToBeDeployed() const;
70+
bool deployStandardQtPlugins(const std::vector<std::string>& plugins);
7171
};
7272
}
7373
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// system headers
22
#include <filesystem>
33

4-
// library headers
5-
#include <linuxdeploy/core/log.h>
6-
74
// local headers
85
#include "BearerPluginsDeployer.h"
96

107
using namespace linuxdeploy::plugin::qt;
11-
using namespace linuxdeploy::core::log;
128

13-
std::vector<std::string> BearerPluginsDeployer::qtPluginsToBeDeployed() const {
14-
return {"bearer"};
9+
bool BearerPluginsDeployer::doDeploy() {
10+
return deployStandardQtPlugins({"bearer"});
1511
}

src/deployers/BearerPluginsDeployer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace linuxdeploy {
1010
// we can just use the base class's constructor
1111
using BasicPluginsDeployer::BasicPluginsDeployer;
1212

13-
std::vector<std::string> qtPluginsToBeDeployed() const override;
13+
bool doDeploy() override;
1414
};
1515
}
1616
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// system headers
22
#include <filesystem>
33

4-
// library headers
5-
#include <linuxdeploy/core/log.h>
6-
74
// local headers
85
#include "GamepadPluginsDeployer.h"
96

107
using namespace linuxdeploy::plugin::qt;
11-
using namespace linuxdeploy::core::log;
128

13-
std::vector<std::string> GamepadPluginsDeployer::qtPluginsToBeDeployed() const {
14-
return {"gamepads"};
9+
bool GamepadPluginsDeployer::doDeploy() {
10+
return deployStandardQtPlugins({"gamepads"});
1511
}

src/deployers/GamepadPluginsDeployer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace linuxdeploy {
1010
// we can just use the base class's constructor
1111
using BasicPluginsDeployer::BasicPluginsDeployer;
1212

13-
std::vector<std::string> qtPluginsToBeDeployed() const override;
13+
bool doDeploy() override;
1414
};
1515
}
1616
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// system headers
22
#include <filesystem>
33

4-
// library headers
5-
#include <linuxdeploy/core/log.h>
6-
74
// local headers
85
#include "LocationPluginsDeployer.h"
96

107
using namespace linuxdeploy::plugin::qt;
11-
using namespace linuxdeploy::core::log;
128

13-
std::vector<std::string> LocationPluginsDeployer::qtPluginsToBeDeployed() const {
14-
return {"geoservices"};
9+
bool LocationPluginsDeployer::doDeploy() {
10+
return deployStandardQtPlugins({"geoservices"});
1511
}

src/deployers/LocationPluginsDeployer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace linuxdeploy {
1010
// we can just use the base class's constructor
1111
using BasicPluginsDeployer::BasicPluginsDeployer;
1212

13-
std::vector<std::string> qtPluginsToBeDeployed() const override;
13+
bool doDeploy() override;
1414
};
1515
}
1616
}
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
// system headers
22
#include <filesystem>
33

4-
// library headers
5-
#include <linuxdeploy/core/log.h>
6-
74
// local headers
85
#include "Multimedia5PluginsDeployer.h"
96

107
using namespace linuxdeploy::plugin::qt;
11-
using namespace linuxdeploy::core::log;
128

13-
std::vector<std::string> Multimedia5PluginsDeployer::qtPluginsToBeDeployed() const {
14-
return {"mediaservice", "audio"};
9+
bool Multimedia5PluginsDeployer::doDeploy() {
10+
return deployStandardQtPlugins({"mediaservice", "audio"});
1511
}

src/deployers/Multimedia5PluginsDeployer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace linuxdeploy {
1010
// we can just use the base class's constructor
1111
using BasicPluginsDeployer::BasicPluginsDeployer;
1212

13-
std::vector<std::string> qtPluginsToBeDeployed() const override;
13+
bool doDeploy() override;
1414
};
1515
}
1616
}

0 commit comments

Comments
 (0)