summaryrefslogtreecommitdiff
path: root/CopyEngineManager.cpp
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2018-02-23 23:49:48 +0000
committerThomas Preud'homme <robotux@celest.fr>2018-02-23 23:49:48 +0000
commitbd56579c7d9de94c17287adefa118290e6b7ba33 (patch)
tree666d7d0b6945b442573b7a3145969f66a53aa460 /CopyEngineManager.cpp
parentb3c8bdcc0d1e4b2ab298847a7902b6d60410a5bc (diff)
New upstream version 1.4.0.3
Diffstat (limited to 'CopyEngineManager.cpp')
-rw-r--r--CopyEngineManager.cpp148
1 files changed, 76 insertions, 72 deletions
diff --git a/CopyEngineManager.cpp b/CopyEngineManager.cpp
index 2355743..a3934b3 100644
--- a/CopyEngineManager.cpp
+++ b/CopyEngineManager.cpp
@@ -7,6 +7,7 @@
#include "CopyEngineManager.h"
#include "LanguagesManager.h"
+#include "cpp11addition.h"
#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT
#include "plugins/CopyEngine/Ultracopier/CopyEngineFactory.h"
@@ -24,7 +25,7 @@ CopyEngineManager::CopyEngineManager(OptionDialog *optionDialog)
connect(PluginsManager::pluginsManager,&PluginsManager::onePluginWillBeRemoved, this,&CopyEngineManager::onePluginWillBeRemoved,Qt::DirectConnection);
#endif
connect(PluginsManager::pluginsManager,&PluginsManager::pluginListingIsfinish, this,&CopyEngineManager::allPluginIsloaded,Qt::QueuedConnection);
- QList<PluginsAvailable> list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_CopyEngine);
+ std::vector<PluginsAvailable> list=PluginsManager::pluginsManager->getPluginsByCategory(PluginType_CopyEngine);
foreach(PluginsAvailable currentPlugin,list)
emit previouslyPluginAdded(currentPlugin);
PluginsManager::pluginsManager->unlockPluginListEdition();
@@ -37,23 +38,23 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
if(plugin.category!=PluginType_CopyEngine)
return;
//setFileName
- QString pluginPath=plugin.path+PluginsManager::getResolvedPluginName(QStringLiteral("copyEngine"));
+ std::string pluginPath=plugin.path+PluginsManager::getResolvedPluginName("copyEngine");
#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE
/*more IO
if(!QFile(pluginPath).exists())
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("The plugin binary is missing: ")+pluginPath);
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"The plugin binary is missing: "+pluginPath);
return;
}*/
#endif
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: ")+pluginPath);
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+pluginPath);
//search into loaded session
- int index=0;
+ unsigned int index=0;
while(index<pluginList.size())
{
if(pluginList.at(index).pluginPath==pluginPath)
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,QStringLiteral("Engine already found!"));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Critical,"Engine already found!");
return;
}
index++;
@@ -63,7 +64,7 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
newItem.path=plugin.path;
newItem.name=plugin.name;
#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE_DIRECT
- newItem.pointer=new QPluginLoader(newItem.pluginPath);
+ newItem.pointer=new QPluginLoader(QString::fromStdString(newItem.pluginPath));
#ifdef ULTRACOPIER_PLUGIN_ALL_IN_ONE
QObjectList objectList=QPluginLoader::staticInstances();
index=0;
@@ -78,15 +79,15 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
}
if(index==objectList.size())
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("static copy engine not found"));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"static copy engine not found");
return;
}
#else
QObject *pluginObject = newItem.pointer->instance();
if(pluginObject==NULL)
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to load the plugin: %1").arg(newItem.pointer->errorString()));
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to load the plugin for %1").arg(newItem.pluginPath));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to load the plugin: "+newItem.pointer->errorString().toStdString());
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to load the plugin for "+newItem.pluginPath);
newItem.pointer->unload();
return;
}
@@ -97,7 +98,7 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
{
if(pluginList.at(index).factory==newItem.factory)
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Plugin already found"));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Plugin already found");
newItem.pointer->unload();
return;
}
@@ -105,7 +106,7 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
}
if(newItem.factory==NULL)
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("unable to cast the plugin: %1").arg(newItem.pointer->errorString()));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to cast the plugin: "+newItem.pointer->errorString().toStdString());
newItem.pointer->unload();
return;
}
@@ -117,7 +118,7 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
#ifdef ULTRACOPIER_DEBUG
connect(newItem.factory,&PluginInterface_CopyEngineFactory::debugInformation,this,&CopyEngineManager::debugInformation,Qt::QueuedConnection);
#endif // ULTRACOPIER_DEBUG
- newItem.options=new LocalPluginOptions(QStringLiteral("CopyEngine-")+newItem.name);
+ newItem.options=new LocalPluginOptions("CopyEngine-"+newItem.name);
newItem.factory->setResources(newItem.options,plugin.writablePath,plugin.path,&FacilityEngine::facilityEngine,ULTRACOPIER_VERSION_PORTABLE_BOOL);
newItem.optionsWidget=newItem.factory->options();
newItem.supportedProtocolsForTheSource=newItem.factory->supportedProtocolsForTheSource();
@@ -126,9 +127,9 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
newItem.type=newItem.factory->getCopyType();
newItem.transferListOperation=newItem.factory->getTransferListOperation();
optionDialog->addPluginOptionWidget(PluginType_CopyEngine,newItem.name,newItem.optionsWidget);
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("plugin: ")+newItem.name+QStringLiteral(" loaded, send options"));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"plugin: "+newItem.name+" loaded, send options");
//emit newCopyEngineOptions(plugin.path,newItem.name,newItem.optionsWidget);
- pluginList << newItem;
+ pluginList.push_back(newItem);
connect(LanguagesManager::languagesManager,&LanguagesManager::newLanguageLoaded,newItem.factory,&PluginInterface_CopyEngineFactory::newLanguageLoaded);
if(PluginsManager::pluginsManager->allPluginHaveBeenLoaded())
allPluginIsloaded();
@@ -139,7 +140,7 @@ void CopyEngineManager::onePluginAdded(const PluginsAvailable &plugin)
#ifndef ULTRACOPIER_PLUGIN_ALL_IN_ONE
void CopyEngineManager::onePluginWillBeRemoved(const PluginsAvailable &plugin)
{
- int index=0;
+ unsigned int index=0;
while(index<pluginList.size())
{
if(pluginList.at(index).path==plugin.path)
@@ -147,7 +148,7 @@ void CopyEngineManager::onePluginWillBeRemoved(const PluginsAvailable &plugin)
if(pluginList.at(index).intances.size()<=0)
{
emit removeCopyEngine(pluginList.at(index).name);
- pluginList.removeAt(index);
+ pluginList.erase(pluginList.begin()+index);
allPluginIsloaded();
return;
}
@@ -160,8 +161,8 @@ void CopyEngineManager::onePluginWillBeUnloaded(const PluginsAvailable &plugin)
{
if(plugin.category!=PluginType_CopyEngine)
return;
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start"));
- int index=0;
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start");
+ unsigned int index=0;
while(index<pluginList.size())
{
if(pluginList.at(index).path==plugin.path)
@@ -176,33 +177,35 @@ void CopyEngineManager::onePluginWillBeUnloaded(const PluginsAvailable &plugin)
}
#endif
-CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultracopier::CopyMode &mode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination)
+CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultracopier::CopyMode &mode,
+ const std::vector<std::string> &protocolsUsedForTheSources,const std::string &protocolsUsedForTheDestination)
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, pluginList.size(): %1, mode: %2, and particular protocol").arg(pluginList.size()).arg((int)mode));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, pluginList.size(): "+std::to_string(pluginList.size())+", mode: "+std::to_string((int)mode)+", and particular protocol");
returnCopyEngine temp;
- int index=0;
+ unsigned int index=0;
bool isTheGoodEngine=false;
while(index<pluginList.size())
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("pluginList.at(%1).name: %2").arg(index).arg(pluginList.at(index).name));
+ const CopyEnginePlugin &copyEnginePlugin=pluginList.at(index);
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"pluginList.at("+std::to_string(index)+").name: "+copyEnginePlugin.name);
isTheGoodEngine=false;
- if(mode!=Ultracopier::Move || !pluginList.at(index).canDoOnlyCopy)
+ if(mode!=Ultracopier::Move || !copyEnginePlugin.canDoOnlyCopy)
{
if(protocolsUsedForTheSources.size()==0)
isTheGoodEngine=true;
else
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("pluginList.at(index).supportedProtocolsForTheDestination: %1").arg(pluginList.at(index).supportedProtocolsForTheDestination.join(";")));
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("protocolsUsedForTheDestination: %1").arg(protocolsUsedForTheDestination));
- if(protocolsUsedForTheDestination.isEmpty() || pluginList.at(index).supportedProtocolsForTheDestination.contains(protocolsUsedForTheDestination))
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"copyEnginePlugin.supportedProtocolsForTheDestination: "+stringimplode(copyEnginePlugin.supportedProtocolsForTheDestination,";"));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"protocolsUsedForTheDestination: "+protocolsUsedForTheDestination);
+ if(protocolsUsedForTheDestination.empty() || vectorcontainsAtLeastOne(copyEnginePlugin.supportedProtocolsForTheDestination,protocolsUsedForTheDestination))
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("pluginList.at(index).supportedProtocolsForTheSource: %1").arg(pluginList.at(index).supportedProtocolsForTheSource.join(";")));
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("protocolsUsedForTheSources.at(indexProto): %1").arg(protocolsUsedForTheSources.join(";")));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"copyEnginePlugin.supportedProtocolsForTheSource: "+stringimplode(copyEnginePlugin.supportedProtocolsForTheSource,";"));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"protocolsUsedForTheSources.at(indexProto): "+stringimplode(protocolsUsedForTheSources,";"));
isTheGoodEngine=true;
- int indexProto=0;
+ unsigned int indexProto=0;
while(indexProto<protocolsUsedForTheSources.size())
{
- if(!pluginList.at(index).supportedProtocolsForTheSource.contains(protocolsUsedForTheSources.at(indexProto)))
+ if(!vectorcontainsAtLeastOne(copyEnginePlugin.supportedProtocolsForTheSource,protocolsUsedForTheSources.at(indexProto)))
{
isTheGoodEngine=false;
break;
@@ -214,8 +217,8 @@ CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultra
}
if(isTheGoodEngine)
{
- pluginList[index].intances<<pluginList.at(index).factory->getInstance();
- temp.engine=pluginList.at(index).intances.last();
+ pluginList[index].intances.push_back(pluginList.at(index).factory->getInstance());
+ temp.engine=pluginList.at(index).intances.back();
temp.canDoOnlyCopy=pluginList.at(index).canDoOnlyCopy;
temp.type=pluginList.at(index).type;
temp.transferListOperation=pluginList.at(index).transferListOperation;
@@ -233,7 +236,7 @@ CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultra
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Cannot find any compatible engine!");
QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any compatible engine!"));
}
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("protocolsUsedForTheSources: %1, protocolsUsedForTheDestination: %2").arg(protocolsUsedForTheSources.join(";")).arg(protocolsUsedForTheDestination));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"protocolsUsedForTheSources: "+stringimplode(protocolsUsedForTheSources,";")+", protocolsUsedForTheDestination: "+protocolsUsedForTheDestination);
temp.engine=NULL;
temp.type=Ultracopier::File;
@@ -241,25 +244,25 @@ CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultra
return temp;
}
-CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultracopier::CopyMode &mode,const QString &name)
+CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultracopier::CopyMode &mode,const std::string &name)
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start, pluginList.size(): %1, with mode: %2, and name: %3").arg(pluginList.size()).arg((int)mode).arg(name));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, pluginList.size(): "+std::to_string(pluginList.size())+", with mode: "+std::to_string((int)mode)+", and name: "+name);
returnCopyEngine temp;
- int index=0;
+ unsigned int index=0;
while(index<pluginList.size())
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("Check matching: %1").arg(pluginList.at(index).name));
- if(pluginList.at(index).name==name)
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"Check matching: "+pluginList.at(index).name);
+ if(pluginList.at(index).name==name || name.empty())
{
if(mode==Ultracopier::Move && pluginList.at(index).canDoOnlyCopy)
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"This copy engine does not support move: pluginList.at(index).canDoOnlyCopy: "+QString::number(pluginList.at(index).canDoOnlyCopy));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"This copy engine does not support move: pluginList.at(index).canDoOnlyCopy: "+std::to_string(pluginList.at(index).canDoOnlyCopy));
QMessageBox::critical(NULL,tr("Warning"),tr("This copy engine does not support move"));
temp.engine=NULL;
return temp;
}
- pluginList[index].intances<<pluginList.at(index).factory->getInstance();
- temp.engine=pluginList.at(index).intances.last();
+ pluginList[index].intances.push_back(pluginList.at(index).factory->getInstance());
+ temp.engine=pluginList.at(index).intances.back();
temp.canDoOnlyCopy=pluginList.at(index).canDoOnlyCopy;
temp.type=pluginList.at(index).type;
temp.transferListOperation=pluginList.at(index).transferListOperation;
@@ -267,8 +270,8 @@ CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultra
}
index++;
}
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Cannot find any engine with this name: %1").arg(name));
- QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any engine with this name: %1").arg(name));
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Cannot find any engine with this name: "+name);
+ QMessageBox::critical(NULL,tr("Warning"),tr("Cannot find any engine with this name: %1").arg(QString::fromStdString(name)));
temp.engine=NULL;
temp.type=Ultracopier::File;
temp.canDoOnlyCopy=true;
@@ -276,19 +279,19 @@ CopyEngineManager::returnCopyEngine CopyEngineManager::getCopyEngine(const Ultra
}
#ifdef ULTRACOPIER_DEBUG
-void CopyEngineManager::debugInformation(const Ultracopier::DebugLevel &level,const QString& fonction,const QString& text,const QString& file,const int& ligne)
+void CopyEngineManager::debugInformation(const Ultracopier::DebugLevel &level,const std::string& fonction,const std::string& text,const std::string& file,const int& ligne)
{
- DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,QStringLiteral("Copy Engine plugin"));
+ DebugEngine::addDebugInformationStatic(level,fonction,text,file,ligne,"Copy Engine plugin");
}
#endif // ULTRACOPIER_DEBUG
/// \brief To notify when new value into a group have changed
-void CopyEngineManager::newOptionValue(const QString &groupName,const QString &variableName,const QVariant &value)
+void CopyEngineManager::newOptionValue(const std::string &groupName,const std::string &variableName,const std::string &value)
{
- if(groupName==QStringLiteral("CopyEngine") && variableName==QStringLiteral("List"))
+ if(groupName=="CopyEngine" && variableName=="List")
{
Q_UNUSED(value)
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"start(\""+groupName+"\",\""+variableName+"\",\""+value.toString()+"\")");
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Information,"start(\""+groupName+"\",\""+variableName+"\",\""+value+"\")");
allPluginIsloaded();
}
}
@@ -299,7 +302,7 @@ void CopyEngineManager::setIsConnected()
prevent bug, I don't know why, in one case it bug here
*/
isConnected=true;
- int index=0;
+ unsigned int index=0;
while(index<pluginList.size())
{
emit addCopyEngine(pluginList.at(index).name,pluginList.at(index).canDoOnlyCopy);
@@ -309,23 +312,23 @@ void CopyEngineManager::setIsConnected()
void CopyEngineManager::allPluginIsloaded()
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start"));
- QStringList actualList;
- int index=0;
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start");
+ std::vector<std::string> actualList;
+ unsigned int index=0;
while(index<pluginList.size())
{
- actualList << pluginList.at(index).name;
+ actualList.push_back(pluginList.at(index).name);
index++;
}
- QStringList preferedList=OptionEngine::optionEngine->getOptionValue(QStringLiteral("CopyEngine"),QStringLiteral("List")).toStringList();
- preferedList.removeDuplicates();
- actualList.removeDuplicates();
+ std::vector<std::string> preferedList=stringsplit(OptionEngine::optionEngine->getOptionValue("CopyEngine","List"),';');
+ vectorRemoveDuplicatesForSmallList(preferedList);
+ vectorRemoveDuplicatesForSmallList(actualList);
index=0;
while(index<preferedList.size())
{
- if(!actualList.contains(preferedList.at(index)))
+ if(!vectorcontainsAtLeastOne(actualList,preferedList.at(index)))
{
- preferedList.removeAt(index);
+ preferedList.erase(preferedList.cbegin()+index);
index--;
}
index++;
@@ -333,21 +336,21 @@ void CopyEngineManager::allPluginIsloaded()
index=0;
while(index<actualList.size())
{
- if(!preferedList.contains(actualList.at(index)))
- preferedList << actualList.at(index);
+ if(!vectorcontainsAtLeastOne(preferedList,actualList.at(index)))
+ preferedList.push_back( actualList.at(index));
index++;
}
- OptionEngine::optionEngine->setOptionValue(QStringLiteral("CopyEngine"),QStringLiteral("List"),preferedList);
- QList<CopyEnginePlugin> newPluginList;
+ OptionEngine::optionEngine->setOptionValue("CopyEngine","List",stringimplode(preferedList,';'));
+ std::vector<CopyEnginePlugin> newPluginList;
index=0;
while(index<preferedList.size())
{
- int pluginListIndex=0;
+ unsigned int pluginListIndex=0;
while(pluginListIndex<pluginList.size())
{
if(preferedList.at(index)==pluginList.at(pluginListIndex).name)
{
- newPluginList << pluginList.at(pluginListIndex);
+ newPluginList.push_back(pluginList.at(pluginListIndex));
break;
}
pluginListIndex++;
@@ -357,20 +360,21 @@ void CopyEngineManager::allPluginIsloaded()
pluginList=newPluginList;
}
-bool CopyEngineManager::protocolsSupportedByTheCopyEngine(PluginInterface_CopyEngine * engine,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination)
+bool CopyEngineManager::protocolsSupportedByTheCopyEngine(PluginInterface_CopyEngine * engine,const std::vector<std::string> &protocolsUsedForTheSources,const std::string &protocolsUsedForTheDestination)
{
- int index=0;
+ unsigned int index=0;
while(index<pluginList.size())
{
- ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("pluginList.at(%1).name: %2").arg(index).arg(pluginList.at(index).name));
- if(pluginList.at(index).intances.contains(engine))
+ const CopyEnginePlugin &copyEnginePlugin=pluginList.at(index);
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"pluginList.at("+std::to_string(index)+").name: "+copyEnginePlugin.name);
+ if(vectorcontainsAtLeastOne(copyEnginePlugin.intances,engine))
{
- if(!pluginList.at(index).supportedProtocolsForTheDestination.contains(protocolsUsedForTheDestination))
+ if(!vectorcontainsAtLeastOne(copyEnginePlugin.supportedProtocolsForTheDestination,protocolsUsedForTheDestination))
return false;
- int indexProto=0;
+ unsigned int indexProto=0;
while(indexProto<protocolsUsedForTheSources.size())
{
- if(!pluginList.at(index).supportedProtocolsForTheSource.contains(protocolsUsedForTheSources.at(indexProto)))
+ if(!vectorcontainsAtLeastOne(copyEnginePlugin.supportedProtocolsForTheSource,protocolsUsedForTheSources.at(indexProto)))
return false;
indexProto++;
}