Skip to content

Commit

Permalink
deployers: Simplify TextToSpeechPluginsDeployer
Browse files Browse the repository at this point in the history
With the refactor of BasicPluginsDeployer, we can collapse the contents of the TextToSpeechPluginsDeployer to just a call into the base class, with the appropriate argument.
  • Loading branch information
tdewey-rpi authored and TheAssassin committed Dec 23, 2024
1 parent 3b6e451 commit 2d9e23f
Showing 1 changed file with 1 addition and 31 deletions.
32 changes: 1 addition & 31 deletions src/deployers/TextToSpeechPluginsDeployer.cpp
Original file line number Diff line number Diff line change
@@ -1,38 +1,8 @@
// system headers
#include <filesystem>

// library headers
#include <linuxdeploy/core/log.h>

// local headers
#include "TextToSpeechPluginsDeployer.h"

using namespace linuxdeploy::plugin::qt;
using namespace linuxdeploy::core::log;

namespace fs = std::filesystem;

bool TextToSpeechPluginsDeployer::doDeploy() {
// calling the default code is optional, but it won't hurt for now
if (!BasicPluginsDeployer::deploy())
return false;

const std::string pluginsName = "texttospeech";

ldLog() << "Deploying" << pluginsName << "plugins" << std::endl;

for (fs::directory_iterator i(qtPluginsPath / pluginsName); i != fs::directory_iterator(); ++i) {
if (i->path().extension() == ".debug") {
ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl;
continue;
}

// terminate with a "/" to make sure the deployer will deploy the file into the target directory properly
// has to be cast to string, unfortunately, as std::filesystem doesn't allow for adding a terminating /
const auto targetPath = (appDir.path() / "usr/plugins/" / pluginsName).string() + "/";
if (!appDir.deployLibrary(*i, targetPath))
return false;
}

return true;
return deployStandardQtPlugins({"texttospeech"});
}

0 comments on commit 2d9e23f

Please sign in to comment.