From bd56579c7d9de94c17287adefa118290e6b7ba33 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Fri, 23 Feb 2018 23:49:48 +0000 Subject: New upstream version 1.4.0.3 --- Core.cpp | 379 ++++++++++++++++++++++++++++++++------------------------------- 1 file changed, 195 insertions(+), 184 deletions(-) (limited to 'Core.cpp') diff --git a/Core.cpp b/Core.cpp index 52d693c..9f0e8eb 100644 --- a/Core.cpp +++ b/Core.cpp @@ -9,10 +9,11 @@ #include "Core.h" #include "ThemesManager.h" +#include "cpp11addition.h" Core::Core(CopyEngineManager *copyEngineList) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); this->copyEngineList=copyEngineList; nextId=0; forUpateInformation.setInterval(ULTRACOPIER_TIME_INTERFACE_UPDATE); @@ -25,7 +26,7 @@ Core::Core(CopyEngineManager *copyEngineList) Core::~Core() { - int index=0; + unsigned int index=0; while(indexcancel(); @@ -36,30 +37,30 @@ Core::~Core() } } -void Core::newCopyWithoutDestination(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources) +void Core::newCopyWithoutDestination(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); if(openNewCopyEngineInstance(Ultracopier::Copy,false,protocolsUsedForTheSources)==-1) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); return; } - copyList.last().orderId<newCopy(sources); - copyList.last().interface->haveExternalOrder(); + copyList.back().orderId.push_back(orderId); + copyList.back().engine->newCopy(sources); + copyList.back().interface->haveExternalOrder(); } -void Core::newTransfer(const Ultracopier::CopyMode &mode,const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination) +void Core::newTransfer(const Ultracopier::CopyMode &mode,const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: ")+sources.join(QStringLiteral(";"))+QStringLiteral(", dest: ")+destination+QStringLiteral(", mode: ")+QString::number(mode)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+stringimplode(sources,";")+", dest: "+destination+", mode: "+std::to_string(mode)); //search to group the window - int GroupWindowWhen=OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("GroupWindowWhen")).toInt(); + int GroupWindowWhen=stringtoint32(OptionEngine::optionEngine->getOptionValue("Ultracopier","GroupWindowWhen")); bool haveSameSource=false,haveSameDestination=false; if(GroupWindowWhen!=0) { - bool needConfirmation=OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("confirmToGroupWindows")).toInt(); - int index=0; + bool needConfirmation=stringtobool(OptionEngine::optionEngine->getOptionValue("Ultracopier","confirmToGroupWindows")); + unsigned int index=0; while(indexnewCopy(sources,destination); else @@ -112,29 +113,29 @@ void Core::newTransfer(const Ultracopier::CopyMode &mode,const quint32 &orderId, //else open new windows if(openNewCopyEngineInstance(mode,false,protocolsUsedForTheSources,protocolsUsedForTheDestination)==-1) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,QStringLiteral("Unable to get a engine instance")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a engine instance"); QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a engine instance")); return; } - copyList.last().orderId<newCopy(sources,destination); + copyList.back().engine->newCopy(sources,destination); else - copyList.last().engine->newMove(sources,destination); - copyList.last().interface->haveExternalOrder(); + copyList.back().engine->newMove(sources,destination); + copyList.back().interface->haveExternalOrder(); } -void Core::newCopy(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination) +void Core::newCopy(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination) { newTransfer(Ultracopier::Copy,orderId,protocolsUsedForTheSources,sources,protocolsUsedForTheDestination,destination); } -void Core::newMove(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources,const QString &protocolsUsedForTheDestination,const QString &destination) +void Core::newMove(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources,const std::string &protocolsUsedForTheDestination,const std::string &destination) { newTransfer(Ultracopier::Move,orderId,protocolsUsedForTheSources,sources,protocolsUsedForTheDestination,destination); } -void Core::newMoveWithoutDestination(const quint32 &orderId,const QStringList &protocolsUsedForTheSources,const QStringList &sources) +void Core::newMoveWithoutDestination(const uint32_t &orderId,const std::vector &protocolsUsedForTheSources,const std::vector &sources) { if(openNewCopyEngineInstance(Ultracopier::Move,false,protocolsUsedForTheSources)==-1) { @@ -142,35 +143,35 @@ void Core::newMoveWithoutDestination(const quint32 &orderId,const QStringList &p QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); return; } - copyList.last().orderId<newMove(sources); - copyList.last().interface->haveExternalOrder(); + copyList.back().orderId.push_back(orderId); + copyList.back().engine->newMove(sources); + copyList.back().interface->haveExternalOrder(); } /// \brief name to open the right copy engine -void Core::addWindowCopyMove(const Ultracopier::CopyMode &mode,const QString &name) +void Core::addWindowCopyMove(const Ultracopier::CopyMode &mode,const std::string &name) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start: ")+name); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start: "+name); if(openNewCopyEngineInstance(mode,false,name)==-1) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); return; } - ActionOnManualOpen ActionOnManualOpen_value=(ActionOnManualOpen)OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("ActionOnManualOpen")).toInt(); + ActionOnManualOpen ActionOnManualOpen_value=static_cast(stringtoint32(OptionEngine::optionEngine->getOptionValue("Ultracopier","ActionOnManualOpen"))); if(ActionOnManualOpen_value!=ActionOnManualOpen_Nothing) { if(ActionOnManualOpen_value==ActionOnManualOpen_Folder) - copyList.last().engine->userAddFolder(mode); + copyList.back().engine->userAddFolder(mode); else - copyList.last().engine->userAddFile(mode); + copyList.back().engine->userAddFile(mode); } } /// \brief name to open the right copy engine -void Core::addWindowTransfer(const QString &name) +void Core::addWindowTransfer(const std::string &name) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")+name); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"+name); if(openNewCopyEngineInstance(Ultracopier::Copy,true,name)==-1) { ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); @@ -180,10 +181,10 @@ void Core::addWindowTransfer(const QString &name) } /** new transfer list pased by the CLI */ -void Core::newTransferList(QString engine,QString mode,QString file) +void Core::newTransferList(std::string engine,std::string mode,std::string file) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("engine: %1, mode: %2, file: %3").arg(engine).arg(mode).arg(file)); - if(mode==QStringLiteral("Transfer")) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"engine: "+engine+", mode: "+mode+", file: "+file); + if(mode=="Transfer") { if(openNewCopyEngineInstance(Ultracopier::Copy,true,engine)==-1) { @@ -192,7 +193,7 @@ void Core::newTransferList(QString engine,QString mode,QString file) return; } } - else if(mode==QStringLiteral("Copy")) + else if(mode=="Copy") { if(openNewCopyEngineInstance(Ultracopier::Copy,false,engine)==-1) { @@ -201,7 +202,7 @@ void Core::newTransferList(QString engine,QString mode,QString file) return; } } - else if(mode==QStringLiteral("Move")) + else if(mode=="Move") { if(openNewCopyEngineInstance(Ultracopier::Move,false,engine)==-1) { @@ -216,17 +217,31 @@ void Core::newTransferList(QString engine,QString mode,QString file) QMessageBox::critical(NULL,tr("Error"),tr("The argument for the mode is not valid")); return; } - copyList.last().engine->newTransferList(file); + copyList.back().engine->newTransferList(file); +} + +bool Core::startNewTransferOneUniqueCopyEngine() +{ + if(copyList.size()!=1) + return false; + + if(openNewCopyEngineInstance(Ultracopier::Copy,true,std::string())==-1) + { + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to get a copy engine instance"); + QMessageBox::critical(NULL,tr("Error"),tr("Unable to get a copy engine instance")); + return false; + } + return true; } void Core::loadInterface() { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); //load the extra files to check the themes availability if(copyList.size()>0) { bool error=false; - int index=0; + unsigned int index=0; while(indexgetThemesInstance(); @@ -239,7 +254,7 @@ void Core::loadInterface() { if(!copyList.at(index).ignoreMode) copyList.at(index).interface->forceCopyMode(copyList.at(index).mode); - connectInterfaceAndSync(copyList.count()-1); + connectInterfaceAndSync(static_cast(copyList.size()-1)); copyList.at(index).engine->syncTransferList(); index++; } @@ -254,10 +269,9 @@ void Core::loadInterface() void Core::unloadInterface() { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); - int index=0; - const int &loop_size=copyList.size(); - while(index2000000) nextId=0; - } while(idList.contains(nextId)); + } while(vectorcontainsAtLeastOne(idList,nextId)); return nextId; } @@ -287,9 +301,10 @@ int Core::incrementId() \param protocolsUsedForTheSources protocols used for sources \param protocolsUsedForTheDestination protocols used for destination */ -int Core::openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode,const QStringList &protocolsUsedForTheSources,const QString &protocolsUsedForTheDestination) +int Core::openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode, + const std::vector &protocolsUsedForTheSources,const std::string &protocolsUsedForTheDestination) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); CopyEngineManager::returnCopyEngine returnInformations=copyEngineList->getCopyEngine(mode,protocolsUsedForTheSources,protocolsUsedForTheDestination); if(returnInformations.engine==NULL) return -1; @@ -302,9 +317,9 @@ int Core::openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool \param protocolsUsedForTheSources protocols used for sources \param protocolsUsedForTheDestination protocols used for destination */ -int Core::openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode,const QString &name) +int Core::openNewCopyEngineInstance(const Ultracopier::CopyMode &mode,const bool &ignoreMode,const std::string &name) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, mode: "+QString::number(mode)+", name: "+name); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start, mode: "+std::to_string(mode)+", name: "+name); CopyEngineManager::returnCopyEngine returnInformations=copyEngineList->getCopyEngine(mode,name); if(returnInformations.engine==NULL) return -1; @@ -348,7 +363,7 @@ int Core::connectCopyEngine(const Ultracopier::CopyMode &mode,bool ignoreMode,co newItem.copyEngineIsSync=true; newItem.canceled=false; - switch(OptionEngine::optionEngine->getOptionValue(QStringLiteral("Ultracopier"),QStringLiteral("remainingTimeAlgorithm")).toUInt()) + switch(stringtoint32(OptionEngine::optionEngine->getOptionValue("Ultracopier","remainingTimeAlgorithm"))) { default: case 0: @@ -363,7 +378,7 @@ int Core::connectCopyEngine(const Ultracopier::CopyMode &mode,bool ignoreMode,co RemainingTimeLogarithmicColumn remainingTimeLogarithmicColumn; remainingTimeLogarithmicColumn.totalSize=0; remainingTimeLogarithmicColumn.transferedSize=0; - newItem.remainingTimeLogarithmicValue << remainingTimeLogarithmicColumn; + newItem.remainingTimeLogarithmicValue.push_back(remainingTimeLogarithmicColumn); index++; } } @@ -377,10 +392,10 @@ int Core::connectCopyEngine(const Ultracopier::CopyMode &mode,bool ignoreMode,co } if(copyList.size()==0) forUpateInformation.start(); - copyList << newItem; - connectEngine(copyList.count()-1); - connectInterfaceAndSync(copyList.count()-1); - return newItem.id; + copyList.push_back(newItem); + connectEngine(static_cast(copyList.size()-1)); + connectInterfaceAndSync(static_cast(copyList.size()-1)); + return static_cast(newItem.id); } ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"Unable to load the interface, copy aborted"); delete newItem.engine; @@ -398,24 +413,25 @@ void Core::resetSpeedDetectedEngine() { int index=indexCopySenderCopyEngine(); if(index!=-1) - resetSpeedDetected(index); + resetSpeedDetected(static_cast(index)); } void Core::resetSpeedDetectedInterface() { int index=indexCopySenderInterface(); if(index!=-1) - resetSpeedDetected(index); + resetSpeedDetected(static_cast(index)); } -void Core::resetSpeedDetected(const int &index) +void Core::resetSpeedDetected(const unsigned int &bindex) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start on %1").arg(index)); + const size_t &index=bindex; + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start on "+std::to_string(index)); switch(copyList.at(index).remainingTimeAlgo) { case Ultracopier::RemainingTimeAlgo_Logarithmic: { - int sub_index=0; + size_t sub_index=0; while(sub_index > &timeList) +void Core::doneTime(const std::vector > &timeList) { int index=indexCopySenderCopyEngine(); if(index!=-1) { - switch(copyList.at(index).remainingTimeAlgo) + CopyInstance ©Instance=copyList[index]; + switch(copyInstance.remainingTimeAlgo) { case Ultracopier::RemainingTimeAlgo_Logarithmic: - if(copyList.at(index).remainingTimeLogarithmicValue.size() &timeUnit=timeList.at(sub_index); - const quint8 &col=fileCatNumber(timeUnit.first); - if(copyList.at(index).remainingTimeLogarithmicValue.size()<=col) + const std::pair &timeUnit=timeList.at(sub_index); + const uint8_t &col=fileCatNumber(timeUnit.first); + RemainingTimeLogarithmicColumn &remainingTimeLogarithmicColumn=copyInstance.remainingTimeLogarithmicValue[col]; + if(copyInstance.remainingTimeLogarithmicValue.size()<=col) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("bug, copyList.at(index).remainingTimeLogarithmicValue.size() %1 < col %2").arg(copyList.at(index).remainingTimeLogarithmicValue.size()).arg(col)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"bug, copyInstance.remainingTimeLogarithmicValue.size() "+std::to_string(copyInstance.remainingTimeLogarithmicValue.size())+" < col %2"+std::to_string(col)); break; } else { if(timeUnit.second>0) { - copyList[index].remainingTimeLogarithmicValue[col].lastProgressionSpeed << timeUnit.first/timeUnit.second; - if(copyList[index].remainingTimeLogarithmicValue[col].lastProgressionSpeed.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) - copyList[index].remainingTimeLogarithmicValue[col].lastProgressionSpeed.removeFirst(); + remainingTimeLogarithmicColumn.lastProgressionSpeed.push_back(static_cast(timeUnit.first/timeUnit.second)); + if(remainingTimeLogarithmicColumn.lastProgressionSpeed.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) + remainingTimeLogarithmicColumn.lastProgressionSpeed.pop_back(); } } sub_index++; } } + break; default: case Ultracopier::RemainingTimeAlgo_Traditional: break; @@ -483,11 +502,11 @@ void Core::actionInProgess(const Ultracopier::EngineActionInProgress &action) int index=indexCopySenderCopyEngine(); if(index!=-1) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("action: %1, from %2").arg(action).arg(index)); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"action: "+std::to_string(action)+", from "+std::to_string(index)); //drop here the duplicate action if(copyList.at(index).action==action) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("The copy engine have send 2x the same EngineActionInProgress")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"The copy engine have send 2x the same EngineActionInProgress"); return; } //update time runing for time remaning caculation @@ -508,9 +527,8 @@ void Core::actionInProgess(const Ultracopier::EngineActionInProgress &action) copyList.at(index).interface->actionInProgess(action); if(action==Ultracopier::Idle) { - int index_sub_loop=0; - const int &loop_size=copyList.at(index).orderId.size(); - while(index_sub_loopsetSupportSpeedLimitation(currentCopyInstance.engine->supportSpeedLimitation()); currentCopyInstance.interface->setCopyType(currentCopyInstance.type); @@ -711,9 +727,8 @@ void Core::connectInterfaceAndSync(const int &index) void Core::periodicSynchronization() { - int index_sub_loop=0; - const int &loop_size=copyList.size(); - while(index_sub_loopULTRACOPIER_MAXVALUESPEEDSTORED) - currentCopyInstance.lastSpeedTime.removeFirst(); + currentCopyInstance.lastSpeedTime.erase(currentCopyInstance.lastSpeedTime.cbegin()); while(currentCopyInstance.lastSpeedDetected.size()>ULTRACOPIER_MAXVALUESPEEDSTORED) - currentCopyInstance.lastSpeedDetected.removeFirst(); + currentCopyInstance.lastSpeedDetected.erase(currentCopyInstance.lastSpeedDetected.cbegin()); while(currentCopyInstance.lastAverageSpeedTime.size()>ULTRACOPIER_MAXVALUESPEEDSTOREDTOREMAININGTIME) - currentCopyInstance.lastAverageSpeedTime.removeFirst(); + currentCopyInstance.lastAverageSpeedTime.erase(currentCopyInstance.lastAverageSpeedTime.cbegin()); while(currentCopyInstance.lastAverageSpeedDetected.size()>ULTRACOPIER_MAXVALUESPEEDSTOREDTOREMAININGTIME) - currentCopyInstance.lastAverageSpeedDetected.removeFirst(); + currentCopyInstance.lastAverageSpeedDetected.erase(currentCopyInstance.lastAverageSpeedDetected.cbegin()); double totTime=0,totAverageTime=0; double totSpeed=0,totAverageSpeed=0; //current speed - int index_sub_loop=0; - int loop_size=currentCopyInstance.lastSpeedDetected.size(); - while(index_sub_loop0) - if(loop_size>=ULTRACOPIER_MINVALUESPEED) + if(currentCopyInstance.lastAverageSpeedDetected.size()>=ULTRACOPIER_MINVALUESPEED) currentCopyInstance.interface->detectedSpeed(totSpeed/totTime); if(totAverageTime>0) - if(loop_size>=ULTRACOPIER_MINVALUESPEEDTOREMAININGTIME) + if(currentCopyInstance.lastAverageSpeedDetected.size()>=ULTRACOPIER_MINVALUESPEEDTOREMAININGTIME) { if(currentCopyInstance.remainingTimeAlgo==Ultracopier::RemainingTimeAlgo_Traditional) { @@ -821,8 +834,7 @@ void Core::periodicSynchronizationWithIndex(const int &index) int remainingTimeValue=0; //calculate for each file class index_sub_loop=0; - loop_size=currentCopyInstance.remainingTimeLogarithmicValue.size(); - while(index_sub_loop=ULTRACOPIER_MINVALUESPEED) { int average_speed=0; - int temp_loop_index=0; + unsigned int temp_loop_index=0; while(temp_loop_indexcancel(); delete currentCopyInstance.nextConditionalSync; delete currentCopyInstance.interface; - int index_sub_loop=0; - const int &loop_size=currentCopyInstance.orderId.size(); - while(index_sub_loop &actionList) +void Core::getActionOnList(const std::vector &actionList) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); //send the the interface const int &index=indexCopySenderCopyEngine(); if(index!=-1) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start2")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start2"); if(copyList.at(index).copyEngineIsSync) copyList.at(index).interface->getActionOnList(actionList); - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start3")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start3"); //log to the file and compute the remaining time if(log.logTransfer() || copyList.at(index).remainingTimeAlgo==Ultracopier::RemainingTimeAlgo_Logarithmic) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start4")); - int sub_index=0; - const int &size=actionList.size(); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start4"); + unsigned int sub_index=0; if(log.logTransfer() && copyList.at(index).remainingTimeAlgo==Ultracopier::RemainingTimeAlgo_Logarithmic) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start5")); - while(sub_index &act } else if(log.logTransfer()) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start6")); - while(sub_index &act } else { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start7")); - while(sub_index &act sub_index++; } } - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start8")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start8"); } - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start9")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start9"); } else ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to locate the copy engine sender"); - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start end")); + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start end"); } -void Core::pushGeneralProgression(const quint64 ¤t,const quint64 &total) +void Core::pushGeneralProgression(const uint64_t ¤t,const uint64_t &total) { int index=indexCopySenderCopyEngine(); if(index!=-1) @@ -1110,18 +1120,19 @@ void Core::pushGeneralProgression(const quint64 ¤t,const quint64 &total) } /// \brief used to drag and drop files -void Core::urlDropped(const QList &urls) +void Core::urlDropped(const std::vector &urls) { - ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,QStringLiteral("start")); - int index=indexCopySenderInterface(); - if(index!=-1) + ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"start"); + int bindex=indexCopySenderInterface(); + if(bindex!=-1) { - QStringList sources; - int index_loop=0; + const unsigned int &index=static_cast(bindex); + std::vector sources; + unsigned int index_loop=0; while(index_loop