comparison plugin/PiperVampPluginFactory.cpp @ 1377:f1c4ca3ccaa3 dev/refactor-piper-related

Change setDesiredExtractor signature to take ServerDescription aggregate.
author Lucas Thompson <lucas.thompson@qmul.ac.uk>
date Fri, 10 Feb 2017 11:30:29 +0000
parents d9511f9e04d7
children
comparison
equal deleted inserted replaced
1376:d9511f9e04d7 1377:f1c4ca3ccaa3
62 62
63 for (auto server: servers) { 63 for (auto server: servers) {
64 for (auto platformHelper: hep.getHelperExecutables(QString::fromStdString(server.name))) 64 for (auto platformHelper: hep.getHelperExecutables(QString::fromStdString(server.name)))
65 m_servers.push_back(platformHelper); 65 m_servers.push_back(platformHelper);
66 if (server.hasDesiredExtractors) { 66 if (server.hasDesiredExtractors) {
67 setDesiredExtractors(server.name, server.extractors); 67 setDesiredExtractors(server);
68 } 68 }
69 } 69 }
70 70
71 for (auto n: m_servers) { 71 for (auto n: m_servers) {
72 SVDEBUG << "NOTE: PiperVampPluginFactory: Found server: " 72 SVDEBUG << "NOTE: PiperVampPluginFactory: Found server: "
90 { 90 {
91 delete m_logger; 91 delete m_logger;
92 } 92 }
93 93
94 void 94 void
95 PiperVampPluginFactory::setDesiredExtractors(ServerName name, 95 PiperVampPluginFactory::setDesiredExtractors(ServerDescription description)
96 DesiredExtractors extractors)
97 { 96 {
98 const bool isValidServerName = std::find_if( 97 const bool isValidServerName = std::find_if(
99 m_servers.begin(), 98 m_servers.begin(),
100 m_servers.end(), 99 m_servers.end(),
101 [&name](const HelperExecPath::HelperExec &h) -> bool { 100 [&description](const HelperExecPath::HelperExec &h) -> bool {
102 return QFileInfo(h.executable).fileName().toStdString() == name; 101 return QFileInfo(h.executable).fileName().toStdString() == description.name;
103 }) != m_servers.end(); 102 }) != m_servers.end();
104 if ( isValidServerName ) { 103 if ( isValidServerName && description.hasDesiredExtractors ) {
105 m_overrideDesiredExtractors[name] = extractors; 104 m_overrideDesiredExtractors[description.name] = description.extractors;
106 } 105 }
107 } 106 }
108 107
109 vector<QString> 108 vector<QString>
110 PiperVampPluginFactory::getPluginIdentifiers(QString &errorMessage) 109 PiperVampPluginFactory::getPluginIdentifiers(QString &errorMessage)