Skip to content

Commit 0a29e02

Browse files
danttiTheAssassin
authored andcommitted
Deploy Qt plugins with default deployStandardQtPlugins() function
1 parent 2826ee5 commit 0a29e02

36 files changed

+70
-114
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: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,23 @@ namespace linuxdeploy {
5050

5151
public:
5252
/**
53-
* This method deploys the plugins returned by \sa qtPluginsToBeDeployed()
54-
* and call \sa customDeploy() to finalize the deployment.
53+
* This method might make some deployment preparation and calls \sa doDeploy() to finalize the deployment.
5554
*/
5655
bool deploy() override final;
5756

5857
protected:
5958
/**
60-
* The \sa deploy() method can deploy Qt plugins that follow the default
61-
* name and path scheme, but some modules are special so
62-
* they should write custom deployment code.
59+
* This method does the actual moduleName deployment, where any special case should be handled and
60+
* \sa deployStandardQtPlugins () method should be called to deploy Qt plugins that follow the default
61+
* name and path scheme.
6362
*/
64-
virtual bool customDeploy();
63+
virtual bool doDeploy();
6564

6665
/**
67-
* Returns a list of Qt plugin names that should be deployed and
66+
* Deploys a list of Qt plugin that should be deployed and
6867
* follow the default name and path scheme.
6968
*/
70-
virtual std::vector<std::string> qtPluginsToBeDeployed() const;
69+
bool deployStandardQtPlugins(const std::vector<std::string>& plugins);
7170
};
7271
}
7372
}
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)