-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deployers: Simplify TextToSpeechPluginsDeployer
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
1 parent
3b6e451
commit 2d9e23f
Showing
1 changed file
with
1 addition
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"}); | ||
} |