CashAgent: changed name: CAmaster

This commit is contained in:
Siegfried Siegert 2023-06-15 14:15:13 +02:00
parent 1f0720e52b
commit 59432735d0
Signed by: SiegfriedSiegert
GPG Key ID: 68371E015E8F0B03

View File

@ -7,6 +7,7 @@
#include <QPluginLoader> #include <QPluginLoader>
#include <QDateTime> #include <QDateTime>
#include <QFileInfo>
ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : QObject(parent), ATBDeviceControllerPlugin::ATBDeviceControllerPlugin(QObject *parent) : QObject(parent),
@ -477,7 +478,26 @@ void ATBDeviceControllerPlugin::onCashPayStoped()
bool ATBDeviceControllerPlugin::private_loadCashAgentLib(QString pluginName) bool ATBDeviceControllerPlugin::private_loadCashAgentLib(QString pluginName)
{ {
if (pluginName == "") { if (pluginName == "") {
pluginName = "/usr/lib/libCashAgentLib.so";
// search list for plugin (.so) file:
QStringList pluginNameList;
pluginNameList << "/usr/lib/libCAmaster.so"
<< "/usr/lib/libCashAgentLib.so";
// using C++11 range based loop:
for (const auto& filename : pluginNameList) {
if (QFileInfo(filename).isReadable()) {
pluginName = filename;
break;
}
}
if (pluginName == "") {
qCritical() << "ATBDeviceControllerPlugin: CashAgentLib not installed!";
this->errorCode = "CashAgentLib::NOT_FOUND";
this->errorDescription = "ERROR: no CashAgentLib: ";
return false;
}
} }
if (!QLibrary::isLibrary(pluginName)) { if (!QLibrary::isLibrary(pluginName)) {