diff --git a/src/deployers/BasicPluginsDeployer.cpp b/src/deployers/BasicPluginsDeployer.cpp index 5de1aca..444dfbe 100644 --- a/src/deployers/BasicPluginsDeployer.cpp +++ b/src/deployers/BasicPluginsDeployer.cpp @@ -29,21 +29,23 @@ BasicPluginsDeployer::BasicPluginsDeployer(std::string moduleName, qtDataPath(std::move(qtDataPath)) {} bool BasicPluginsDeployer::deploy() { - for (const auto &pluginName : qtPluginsToBeDeployed()) { - ldLog() << "Deploying" << pluginName << "plugins" << std::endl; + // currently this is a no-op, but we might add more functionality later on, such as some kinds of default + // attempts to copy data based on the moduleName + return doDeploy(); +} + +bool BasicPluginsDeployer::deployStandardQtPlugins(const std::vector& plugins) +{ + for (const auto &pluginName : plugins) { + ldLog() << "Deploying Qt" << pluginName << "plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / pluginName); i != fs::directory_iterator(); ++i) { if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins" / pluginName)) return false; } } - - return customDeploy(); -} - -bool BasicPluginsDeployer::customDeploy() { return true; } -std::vector BasicPluginsDeployer::qtPluginsToBeDeployed() const { - return {}; +bool BasicPluginsDeployer::doDeploy() { + return true; } diff --git a/src/deployers/BasicPluginsDeployer.h b/src/deployers/BasicPluginsDeployer.h index c6df18c..0eaca0c 100644 --- a/src/deployers/BasicPluginsDeployer.h +++ b/src/deployers/BasicPluginsDeployer.h @@ -50,24 +50,23 @@ namespace linuxdeploy { public: /** - * This method deploys the plugins returned by \sa qtPluginsToBeDeployed() - * and call \sa customDeploy() to finalize the deployment. + * This method might make some deployment preparation and calls \sa doDeploy() to finalize the deployment. */ bool deploy() override final; protected: /** - * The \sa deploy() method can deploy Qt plugins that follow the default - * name and path scheme, but some modules are special so - * they should write custom deployment code. + * This method does the actual moduleName deployment, where any special case should be handled and + * \sa deployStandardQtPlugins () method should be called to deploy Qt plugins that follow the default + * name and path scheme. */ - virtual bool customDeploy(); + virtual bool doDeploy(); /** - * Returns a list of Qt plugin names that should be deployed and + * Deploys a list of Qt plugin that should be deployed and * follow the default name and path scheme. */ - virtual std::vector qtPluginsToBeDeployed() const; + bool deployStandardQtPlugins(const std::vector& plugins); }; } } diff --git a/src/deployers/BearerPluginsDeployer.cpp b/src/deployers/BearerPluginsDeployer.cpp index 9aee6dc..96ffd14 100644 --- a/src/deployers/BearerPluginsDeployer.cpp +++ b/src/deployers/BearerPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "BearerPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector BearerPluginsDeployer::qtPluginsToBeDeployed() const { - return {"bearer"}; +bool BearerPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"bearer"}); } diff --git a/src/deployers/BearerPluginsDeployer.h b/src/deployers/BearerPluginsDeployer.h index fb87dd4..f7e25d8 100644 --- a/src/deployers/BearerPluginsDeployer.h +++ b/src/deployers/BearerPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/GamepadPluginsDeployer.cpp b/src/deployers/GamepadPluginsDeployer.cpp index ae99fcb..4a2c8ee 100644 --- a/src/deployers/GamepadPluginsDeployer.cpp +++ b/src/deployers/GamepadPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "GamepadPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector GamepadPluginsDeployer::qtPluginsToBeDeployed() const { - return {"gamepads"}; +bool GamepadPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"gamepads"}); } diff --git a/src/deployers/GamepadPluginsDeployer.h b/src/deployers/GamepadPluginsDeployer.h index 44fd36c..f11c775 100644 --- a/src/deployers/GamepadPluginsDeployer.h +++ b/src/deployers/GamepadPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/LocationPluginsDeployer.cpp b/src/deployers/LocationPluginsDeployer.cpp index 3948ab5..95c4bb0 100644 --- a/src/deployers/LocationPluginsDeployer.cpp +++ b/src/deployers/LocationPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "LocationPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector LocationPluginsDeployer::qtPluginsToBeDeployed() const { - return {"geoservices"}; +bool LocationPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"geoservices"}); } diff --git a/src/deployers/LocationPluginsDeployer.h b/src/deployers/LocationPluginsDeployer.h index 606dd06..b4bb4e8 100644 --- a/src/deployers/LocationPluginsDeployer.h +++ b/src/deployers/LocationPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/Multimedia5PluginsDeployer.cpp b/src/deployers/Multimedia5PluginsDeployer.cpp index 94be8ec..136ae71 100644 --- a/src/deployers/Multimedia5PluginsDeployer.cpp +++ b/src/deployers/Multimedia5PluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "Multimedia5PluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector Multimedia5PluginsDeployer::qtPluginsToBeDeployed() const { - return {"mediaservice", "audio"}; +bool Multimedia5PluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"mediaservice", "audio"}); } diff --git a/src/deployers/Multimedia5PluginsDeployer.h b/src/deployers/Multimedia5PluginsDeployer.h index 89f6908..7e14150 100644 --- a/src/deployers/Multimedia5PluginsDeployer.h +++ b/src/deployers/Multimedia5PluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/Multimedia6PluginsDeployer.cpp b/src/deployers/Multimedia6PluginsDeployer.cpp index b23c1bd..709c81b 100644 --- a/src/deployers/Multimedia6PluginsDeployer.cpp +++ b/src/deployers/Multimedia6PluginsDeployer.cpp @@ -12,11 +12,11 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -std::vector Multimedia6PluginsDeployer::qtPluginsToBeDeployed() const { +bool Multimedia6PluginsDeployer::doDeploy() { if (fs::exists(qtPluginsPath / "multimedia")) { - return {"multimedia"}; + return deployStandardQtPlugins({"multimedia"}); } else { ldLog() << LD_WARNING << "Missing Qt 6 multimedia plugins, skipping." << std::endl; - return {}; + return true; } } diff --git a/src/deployers/Multimedia6PluginsDeployer.h b/src/deployers/Multimedia6PluginsDeployer.h index a0e045d..f4d2795 100644 --- a/src/deployers/Multimedia6PluginsDeployer.h +++ b/src/deployers/Multimedia6PluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/PlatformPluginsDeployer.cpp b/src/deployers/PlatformPluginsDeployer.cpp index abe32c0..04f8e37 100644 --- a/src/deployers/PlatformPluginsDeployer.cpp +++ b/src/deployers/PlatformPluginsDeployer.cpp @@ -13,7 +13,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool PlatformPluginsDeployer::customDeploy() { +bool PlatformPluginsDeployer::doDeploy() { ldLog() << "Deploying platform plugins" << std::endl; // always deploy default platform @@ -30,6 +30,10 @@ bool PlatformPluginsDeployer::customDeploy() { } } + if (!deployStandardQtPlugins({"platforminputcontexts", "imageformats"})) { + return false; + } + // TODO: platform themes -- https://github.com/probonopd/linuxdeployqt/issues/236 const fs::path platformThemesPath = qtPluginsPath / "platformthemes"; @@ -68,7 +72,3 @@ bool PlatformPluginsDeployer::customDeploy() { return true; } - -std::vector PlatformPluginsDeployer::qtPluginsToBeDeployed() const { - return {"platforminputcontexts", "imageformats"}; -} diff --git a/src/deployers/PlatformPluginsDeployer.h b/src/deployers/PlatformPluginsDeployer.h index c235894..ca4c9b6 100644 --- a/src/deployers/PlatformPluginsDeployer.h +++ b/src/deployers/PlatformPluginsDeployer.h @@ -10,8 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/PositioningPluginsDeployer.cpp b/src/deployers/PositioningPluginsDeployer.cpp index 3056e06..02d7459 100644 --- a/src/deployers/PositioningPluginsDeployer.cpp +++ b/src/deployers/PositioningPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "PositioningPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector PositioningPluginsDeployer::qtPluginsToBeDeployed() const { - return {"position"}; +bool PositioningPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"position"}); } diff --git a/src/deployers/PositioningPluginsDeployer.h b/src/deployers/PositioningPluginsDeployer.h index af5ae0a..b39eb7c 100644 --- a/src/deployers/PositioningPluginsDeployer.h +++ b/src/deployers/PositioningPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/PrintSupportPluginsDeployer.cpp b/src/deployers/PrintSupportPluginsDeployer.cpp index eb7a8af..d1b8ef5 100644 --- a/src/deployers/PrintSupportPluginsDeployer.cpp +++ b/src/deployers/PrintSupportPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "PrintSupportPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector PrintSupportPluginsDeployer::qtPluginsToBeDeployed() const { - return {"printsupport"}; +bool PrintSupportPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"printsupport"}); } diff --git a/src/deployers/PrintSupportPluginsDeployer.h b/src/deployers/PrintSupportPluginsDeployer.h index 9b502c9..797f4ed 100644 --- a/src/deployers/PrintSupportPluginsDeployer.h +++ b/src/deployers/PrintSupportPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/QmlPluginsDeployer.cpp b/src/deployers/QmlPluginsDeployer.cpp index c072ce7..1b8c488 100644 --- a/src/deployers/QmlPluginsDeployer.cpp +++ b/src/deployers/QmlPluginsDeployer.cpp @@ -8,7 +8,7 @@ using namespace linuxdeploy::plugin::qt; namespace fs = std::filesystem; -bool QmlPluginsDeployer::customDeploy() { +bool QmlPluginsDeployer::doDeploy() { try { deployQml(appDir, qtInstallQmlPath); } catch (const QmlImportScannerError &) { diff --git a/src/deployers/QmlPluginsDeployer.h b/src/deployers/QmlPluginsDeployer.h index 54e20e3..6c4e897 100644 --- a/src/deployers/QmlPluginsDeployer.h +++ b/src/deployers/QmlPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/Qt3DPluginsDeployer.cpp b/src/deployers/Qt3DPluginsDeployer.cpp index d431dba..4eaad20 100644 --- a/src/deployers/Qt3DPluginsDeployer.cpp +++ b/src/deployers/Qt3DPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "Qt3DPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector Qt3DPluginsDeployer::qtPluginsToBeDeployed() const { - return {"geometryloaders", "sceneparsers"}; +bool Qt3DPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"geometryloaders", "sceneparsers"}); } diff --git a/src/deployers/Qt3DPluginsDeployer.h b/src/deployers/Qt3DPluginsDeployer.h index 56610f2..96ed8c8 100644 --- a/src/deployers/Qt3DPluginsDeployer.h +++ b/src/deployers/Qt3DPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/SqlPluginsDeployer.cpp b/src/deployers/SqlPluginsDeployer.cpp index a9a7d2a..b7d241a 100644 --- a/src/deployers/SqlPluginsDeployer.cpp +++ b/src/deployers/SqlPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "SqlPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector SqlPluginsDeployer::qtPluginsToBeDeployed() const { - return {"sqldrivers"}; +bool SqlPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"sqldrivers"}); } diff --git a/src/deployers/SqlPluginsDeployer.h b/src/deployers/SqlPluginsDeployer.h index 0a88cd4..bad131f 100644 --- a/src/deployers/SqlPluginsDeployer.h +++ b/src/deployers/SqlPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/SvgPluginsDeployer.cpp b/src/deployers/SvgPluginsDeployer.cpp index 8b59c5d..36f452a 100644 --- a/src/deployers/SvgPluginsDeployer.cpp +++ b/src/deployers/SvgPluginsDeployer.cpp @@ -12,7 +12,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool SvgPluginsDeployer::customDeploy() { +bool SvgPluginsDeployer::doDeploy() { ldLog() << "Deploying svg icon engine" << std::endl; if (!appDir.deployLibrary(qtPluginsPath / "iconengines/libqsvgicon.so", appDir.path() / "usr/plugins/iconengines/")) diff --git a/src/deployers/SvgPluginsDeployer.h b/src/deployers/SvgPluginsDeployer.h index bd5cb2f..5394c1f 100644 --- a/src/deployers/SvgPluginsDeployer.h +++ b/src/deployers/SvgPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/TextToSpeechPluginsDeployer.cpp b/src/deployers/TextToSpeechPluginsDeployer.cpp index c2939d8..8b8e2c2 100644 --- a/src/deployers/TextToSpeechPluginsDeployer.cpp +++ b/src/deployers/TextToSpeechPluginsDeployer.cpp @@ -12,7 +12,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool TextToSpeechPluginsDeployer::customDeploy() { +bool TextToSpeechPluginsDeployer::doDeploy() { // calling the default code is optional, but it won't hurt for now if (!BasicPluginsDeployer::deploy()) return false; diff --git a/src/deployers/TextToSpeechPluginsDeployer.h b/src/deployers/TextToSpeechPluginsDeployer.h index 2a07fd0..9c540fd 100644 --- a/src/deployers/TextToSpeechPluginsDeployer.h +++ b/src/deployers/TextToSpeechPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/TlsBackendsDeployer.cpp b/src/deployers/TlsBackendsDeployer.cpp index 10badc1..aae471f 100644 --- a/src/deployers/TlsBackendsDeployer.cpp +++ b/src/deployers/TlsBackendsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "TlsBackendsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector TlsBackendsDeployer::qtPluginsToBeDeployed() const { - return {"tls"}; +bool TlsBackendsDeployer::doDeploy() { + return deployStandardQtPlugins({"tls"}); } diff --git a/src/deployers/TlsBackendsDeployer.h b/src/deployers/TlsBackendsDeployer.h index 2a2364d..460532b 100644 --- a/src/deployers/TlsBackendsDeployer.h +++ b/src/deployers/TlsBackendsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/WaylandcompositorPluginsDeployer.cpp b/src/deployers/WaylandcompositorPluginsDeployer.cpp index 489301f..55cfdc2 100644 --- a/src/deployers/WaylandcompositorPluginsDeployer.cpp +++ b/src/deployers/WaylandcompositorPluginsDeployer.cpp @@ -1,17 +1,13 @@ // system headers #include -// library headers -#include - // local headers #include "WaylandcompositorPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector WaylandcompositorPluginsDeployer::qtPluginsToBeDeployed() const { - return {"wayland-decoration-client", - "wayland-graphics-integration-client", - "wayland-shell-integration",}; +bool WaylandcompositorPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"wayland-decoration-client", + "wayland-graphics-integration-client", + "wayland-shell-integration",}); } diff --git a/src/deployers/WaylandcompositorPluginsDeployer.h b/src/deployers/WaylandcompositorPluginsDeployer.h index 0f9d552..f27a5fb 100644 --- a/src/deployers/WaylandcompositorPluginsDeployer.h +++ b/src/deployers/WaylandcompositorPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/WebEnginePluginsDeployer.cpp b/src/deployers/WebEnginePluginsDeployer.cpp index a02be57..7ca70bc 100644 --- a/src/deployers/WebEnginePluginsDeployer.cpp +++ b/src/deployers/WebEnginePluginsDeployer.cpp @@ -14,11 +14,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool WebEnginePluginsDeployer::customDeploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +bool WebEnginePluginsDeployer::doDeploy() { ldLog() << "Deploying web engine plugins" << std::endl; const auto newLibexecPath = appDir.path() / "usr/libexec/"; diff --git a/src/deployers/WebEnginePluginsDeployer.h b/src/deployers/WebEnginePluginsDeployer.h index a0cf050..a76997b 100644 --- a/src/deployers/WebEnginePluginsDeployer.h +++ b/src/deployers/WebEnginePluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/XcbglIntegrationPluginsDeployer.cpp b/src/deployers/XcbglIntegrationPluginsDeployer.cpp index a8d1e18..be24abb 100644 --- a/src/deployers/XcbglIntegrationPluginsDeployer.cpp +++ b/src/deployers/XcbglIntegrationPluginsDeployer.cpp @@ -8,7 +8,7 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -bool XcbglIntegrationPluginsDeployer::customDeploy() { +bool XcbglIntegrationPluginsDeployer::doDeploy() { ldLog() << "Deploying xcb-gl integrations" << std::endl; return deployIntegrationPlugins(appDir, qtPluginsPath, {"xcbglintegrations/"}); diff --git a/src/deployers/XcbglIntegrationPluginsDeployer.h b/src/deployers/XcbglIntegrationPluginsDeployer.h index 6523393..eade482 100644 --- a/src/deployers/XcbglIntegrationPluginsDeployer.h +++ b/src/deployers/XcbglIntegrationPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } }