diff --git a/src/deployers/BasicPluginsDeployer.cpp b/src/deployers/BasicPluginsDeployer.cpp index ba927c1..444dfbe 100644 --- a/src/deployers/BasicPluginsDeployer.cpp +++ b/src/deployers/BasicPluginsDeployer.cpp @@ -31,5 +31,21 @@ BasicPluginsDeployer::BasicPluginsDeployer(std::string moduleName, bool BasicPluginsDeployer::deploy() { // 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 true; +} + +bool BasicPluginsDeployer::doDeploy() { return true; } diff --git a/src/deployers/BasicPluginsDeployer.h b/src/deployers/BasicPluginsDeployer.h index 1394f53..0eaca0c 100644 --- a/src/deployers/BasicPluginsDeployer.h +++ b/src/deployers/BasicPluginsDeployer.h @@ -49,7 +49,24 @@ namespace linuxdeploy { virtual ~BasicPluginsDeployer() = default; public: - bool deploy() override; + /** + * This method might make some deployment preparation and calls \sa doDeploy() to finalize the deployment. + */ + bool deploy() override final; + + protected: + /** + * 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 doDeploy(); + + /** + * Deploys a list of Qt plugin that should be deployed and + * follow the default name and path scheme. + */ + bool deployStandardQtPlugins(const std::vector& plugins); }; } } diff --git a/src/deployers/BearerPluginsDeployer.cpp b/src/deployers/BearerPluginsDeployer.cpp index 5784060..96ffd14 100644 --- a/src/deployers/BearerPluginsDeployer.cpp +++ b/src/deployers/BearerPluginsDeployer.cpp @@ -1,28 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "BearerPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool BearerPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying bearer plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "bearer"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/bearer/")) - return false; - } - return true; +bool BearerPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"bearer"}); } diff --git a/src/deployers/BearerPluginsDeployer.h b/src/deployers/BearerPluginsDeployer.h index 91a8c77..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/GamepadPluginsDeployer.cpp b/src/deployers/GamepadPluginsDeployer.cpp index 6ebedb7..4a2c8ee 100644 --- a/src/deployers/GamepadPluginsDeployer.cpp +++ b/src/deployers/GamepadPluginsDeployer.cpp @@ -1,28 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "GamepadPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool GamepadPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying Gamepad plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "gamepads"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/gamepads/")) - return false; - } - return true; +bool GamepadPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"gamepads"}); } diff --git a/src/deployers/GamepadPluginsDeployer.h b/src/deployers/GamepadPluginsDeployer.h index a0d28fa..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/LocationPluginsDeployer.cpp b/src/deployers/LocationPluginsDeployer.cpp index 689f2c8..95c4bb0 100644 --- a/src/deployers/LocationPluginsDeployer.cpp +++ b/src/deployers/LocationPluginsDeployer.cpp @@ -1,28 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "LocationPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool LocationPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying Location plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "geoservices"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/geoservices/")) - return false; - } - return true; +bool LocationPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"geoservices"}); } diff --git a/src/deployers/LocationPluginsDeployer.h b/src/deployers/LocationPluginsDeployer.h index 645f32c..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/Multimedia5PluginsDeployer.cpp b/src/deployers/Multimedia5PluginsDeployer.cpp index 0718328..136ae71 100644 --- a/src/deployers/Multimedia5PluginsDeployer.cpp +++ b/src/deployers/Multimedia5PluginsDeployer.cpp @@ -1,35 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "Multimedia5PluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool Multimedia5PluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying mediaservice plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "mediaservice"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/mediaservice/")) - return false; - } - - ldLog() << "Deploying audio plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "audio"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/audio/")) - return false; - } - return true; +bool Multimedia5PluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"mediaservice", "audio"}); } diff --git a/src/deployers/Multimedia5PluginsDeployer.h b/src/deployers/Multimedia5PluginsDeployer.h index b674ace..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/Multimedia6PluginsDeployer.cpp b/src/deployers/Multimedia6PluginsDeployer.cpp index 2ea8fee..709c81b 100644 --- a/src/deployers/Multimedia6PluginsDeployer.cpp +++ b/src/deployers/Multimedia6PluginsDeployer.cpp @@ -12,21 +12,11 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool Multimedia6PluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +bool Multimedia6PluginsDeployer::doDeploy() { if (fs::exists(qtPluginsPath / "multimedia")) { - ldLog() << "Deploying multimedia plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "multimedia"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/multimedia/")) - return false; - } + return deployStandardQtPlugins({"multimedia"}); } else { ldLog() << LD_WARNING << "Missing Qt 6 multimedia plugins, skipping." << std::endl; + return true; } - - return true; } diff --git a/src/deployers/Multimedia6PluginsDeployer.h b/src/deployers/Multimedia6PluginsDeployer.h index 60d61cc..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/PlatformPluginsDeployer.cpp b/src/deployers/PlatformPluginsDeployer.cpp index 5d5076b..04f8e37 100644 --- a/src/deployers/PlatformPluginsDeployer.cpp +++ b/src/deployers/PlatformPluginsDeployer.cpp @@ -13,11 +13,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool PlatformPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +bool PlatformPluginsDeployer::doDeploy() { ldLog() << "Deploying platform plugins" << std::endl; // always deploy default platform @@ -32,16 +28,10 @@ bool PlatformPluginsDeployer::deploy() { if (!appDir.deployLibrary(qtPluginsPath / "platforms" / platformToDeploy, appDir.path() / "usr/plugins/platforms/")) return false; } - } - - for (fs::directory_iterator i(qtPluginsPath / "platforminputcontexts"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/platforminputcontexts/")) - return false; } - for (fs::directory_iterator i(qtPluginsPath / "imageformats"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/imageformats/")) - return false; + if (!deployStandardQtPlugins({"platforminputcontexts", "imageformats"})) { + return false; } // TODO: platform themes -- https://github.com/probonopd/linuxdeployqt/issues/236 diff --git a/src/deployers/PlatformPluginsDeployer.h b/src/deployers/PlatformPluginsDeployer.h index 20379f8..ca4c9b6 100644 --- a/src/deployers/PlatformPluginsDeployer.h +++ b/src/deployers/PlatformPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/PluginsDeployerFactory.cpp b/src/deployers/PluginsDeployerFactory.cpp index ea88ec2..18a9130 100644 --- a/src/deployers/PluginsDeployerFactory.cpp +++ b/src/deployers/PluginsDeployerFactory.cpp @@ -73,9 +73,9 @@ std::vector> PluginsDeployerFactory::getDeploye } if (moduleName == "multimedia") { - if (qtMajorVersion < 6) { + if (qtMajorVersion < 6) { return {getInstance(moduleName)}; - } else { + } else { return {getInstance(moduleName)}; } } diff --git a/src/deployers/PositioningPluginsDeployer.cpp b/src/deployers/PositioningPluginsDeployer.cpp index 5c95e7f..02d7459 100644 --- a/src/deployers/PositioningPluginsDeployer.cpp +++ b/src/deployers/PositioningPluginsDeployer.cpp @@ -1,28 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "PositioningPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool PositioningPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying positioning plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "position"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/position/")) - return false; - } - return true; +bool PositioningPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"position"}); } diff --git a/src/deployers/PositioningPluginsDeployer.h b/src/deployers/PositioningPluginsDeployer.h index c60e221..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/PrintSupportPluginsDeployer.cpp b/src/deployers/PrintSupportPluginsDeployer.cpp index 15c1d86..d1b8ef5 100644 --- a/src/deployers/PrintSupportPluginsDeployer.cpp +++ b/src/deployers/PrintSupportPluginsDeployer.cpp @@ -1,28 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "PrintSupportPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool PrintSupportPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying printsupport plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "printsupport"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/printsupport/")) - return false; - } - return true; +bool PrintSupportPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"printsupport"}); } diff --git a/src/deployers/PrintSupportPluginsDeployer.h b/src/deployers/PrintSupportPluginsDeployer.h index 6780d06..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/QmlPluginsDeployer.cpp b/src/deployers/QmlPluginsDeployer.cpp index e538ea1..1b8c488 100644 --- a/src/deployers/QmlPluginsDeployer.cpp +++ b/src/deployers/QmlPluginsDeployer.cpp @@ -8,11 +8,7 @@ using namespace linuxdeploy::plugin::qt; namespace fs = std::filesystem; -bool QmlPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +bool QmlPluginsDeployer::doDeploy() { try { deployQml(appDir, qtInstallQmlPath); } catch (const QmlImportScannerError &) { diff --git a/src/deployers/QmlPluginsDeployer.h b/src/deployers/QmlPluginsDeployer.h index 28ddc0d..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 deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/Qt3DPluginsDeployer.cpp b/src/deployers/Qt3DPluginsDeployer.cpp index 635ea04..4eaad20 100644 --- a/src/deployers/Qt3DPluginsDeployer.cpp +++ b/src/deployers/Qt3DPluginsDeployer.cpp @@ -1,33 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "Qt3DPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool Qt3DPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying Qt 3D plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "geometryloaders"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/geometryloaders/")) - return false; - } - - for (fs::directory_iterator i(qtPluginsPath / "sceneparsers"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/sceneparsers/")) - return false; - } - return true; +bool Qt3DPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"geometryloaders", "sceneparsers"}); } diff --git a/src/deployers/Qt3DPluginsDeployer.h b/src/deployers/Qt3DPluginsDeployer.h index 5810a34..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/SqlPluginsDeployer.cpp b/src/deployers/SqlPluginsDeployer.cpp index 6d0111b..b7d241a 100644 --- a/src/deployers/SqlPluginsDeployer.cpp +++ b/src/deployers/SqlPluginsDeployer.cpp @@ -1,28 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "SqlPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool SqlPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying SQL plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "sqldrivers"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/sqldrivers/")) - return false; - } - return true; +bool SqlPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"sqldrivers"}); } diff --git a/src/deployers/SqlPluginsDeployer.h b/src/deployers/SqlPluginsDeployer.h index 9329aef..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/SvgPluginsDeployer.cpp b/src/deployers/SvgPluginsDeployer.cpp index 90a628d..36f452a 100644 --- a/src/deployers/SvgPluginsDeployer.cpp +++ b/src/deployers/SvgPluginsDeployer.cpp @@ -12,11 +12,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool SvgPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +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 18466b6..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 deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/TextToSpeechPluginsDeployer.cpp b/src/deployers/TextToSpeechPluginsDeployer.cpp index a0124d6..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::deploy() { +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 2138723..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 deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/TlsBackendsDeployer.cpp b/src/deployers/TlsBackendsDeployer.cpp index e6c84b9..aae471f 100644 --- a/src/deployers/TlsBackendsDeployer.cpp +++ b/src/deployers/TlsBackendsDeployer.cpp @@ -1,28 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "TlsBackendsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool TlsBackendsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying TLS backends" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "tls"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/tls/")) - return false; - } - return true; +bool TlsBackendsDeployer::doDeploy() { + return deployStandardQtPlugins({"tls"}); } diff --git a/src/deployers/TlsBackendsDeployer.h b/src/deployers/TlsBackendsDeployer.h index e3aa3a2..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/WaylandcompositorPluginsDeployer.cpp b/src/deployers/WaylandcompositorPluginsDeployer.cpp index 3a0e667..55cfdc2 100644 --- a/src/deployers/WaylandcompositorPluginsDeployer.cpp +++ b/src/deployers/WaylandcompositorPluginsDeployer.cpp @@ -1,38 +1,13 @@ // system headers #include -// library headers -#include - // local headers #include "WaylandcompositorPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; - -bool WaylandcompositorPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying waylandcompositor plugin" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "wayland-decoration-client"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-decoration-client/")) - return false; - } - - for (fs::directory_iterator i(qtPluginsPath / "wayland-graphics-integration-client"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-graphics-integration-client/")) - return false; - } - - for (fs::directory_iterator i(qtPluginsPath / "wayland-shell-integration"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-shell-integration/")) - return false; - } - return true; +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 3840002..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; - bool deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/WebEnginePluginsDeployer.cpp b/src/deployers/WebEnginePluginsDeployer.cpp index f93ed1f..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::deploy() { - // 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 64ba8bd..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 deploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/XcbglIntegrationPluginsDeployer.cpp b/src/deployers/XcbglIntegrationPluginsDeployer.cpp index 21c54a4..be24abb 100644 --- a/src/deployers/XcbglIntegrationPluginsDeployer.cpp +++ b/src/deployers/XcbglIntegrationPluginsDeployer.cpp @@ -8,11 +8,7 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -bool XcbglIntegrationPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +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 23d1db5..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 deploy() override; + bool doDeploy() override; }; } }