summaryrefslogtreecommitdiff
path: root/plugins/CopyEngine/Ultracopier/ListThread.cpp
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2018-05-29 05:44:34 +0100
committerThomas Preud'homme <robotux@celest.fr>2018-05-29 05:44:34 +0100
commit594fcba67600704bee9115c86e18927b2237b304 (patch)
tree38dc620e6b8e9a76c1953ded39c1dc006a830728 /plugins/CopyEngine/Ultracopier/ListThread.cpp
parent20062a6a4bc2aec8ada645baa78ff68892ccd154 (diff)
New upstream version 1.4.0.8
Diffstat (limited to 'plugins/CopyEngine/Ultracopier/ListThread.cpp')
-rw-r--r--plugins/CopyEngine/Ultracopier/ListThread.cpp29
1 files changed, 27 insertions, 2 deletions
diff --git a/plugins/CopyEngine/Ultracopier/ListThread.cpp b/plugins/CopyEngine/Ultracopier/ListThread.cpp
index 8d47326..970536a 100644
--- a/plugins/CopyEngine/Ultracopier/ListThread.cpp
+++ b/plugins/CopyEngine/Ultracopier/ListThread.cpp
@@ -1,6 +1,7 @@
#include "ListThread.h"
#include <QStorageInfo>
#include <QMutexLocker>
+#include <QtGlobal>
#include "../../../cpp11addition.h"
ListThread::ListThread(FacilityInterface * facilityInterface)
@@ -483,9 +484,33 @@ bool ListThread::newCopy(const std::vector<std::string> &sources,const std::stri
ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Warning,"unable to get new thread");
return false;
}
- scanFileOrFolderThread->addToList(sources,destination);
+ std::regex base_regex("^[a-z][a-z][a-z]*:/.*");
+ std::smatch base_match;
+ std::vector<std::string> sourcesClean;
+ unsigned int index=0;
+ while(index<sources.size())
+ {
+ std::string source=sources.at(index);
+ #ifndef Q_OS_WIN
+ if(stringStartWith(source,"file:///"))
+ source.replace(0,7,"");
+ #else
+ if(stringStartWith(source,"file:///"))
+ source.replace(0,8,"");
+ else if(stringStartWith(source,"file://"))
+ source.replace(0,7,"");
+ else if(stringStartWith(source,"file:/"))
+ source.replace(0,6,"");
+ #endif
+ else if (std::regex_match(source, base_match, base_regex))
+ return false;
+ index++;
+ sourcesClean.push_back(source);
+ }
+ ULTRACOPIER_DEBUGCONSOLE(Ultracopier::DebugLevel_Notice,"sourcesClean: "+stringimplode(sourcesClean,";"));
+ scanFileOrFolderThread->addToList(sourcesClean,destination);
scanThreadHaveFinish(true);
- detectDrivesOfCurrentTransfer(sources,destination);
+ detectDrivesOfCurrentTransfer(sourcesClean,destination);
return true;
}