Commit 63c458e6 authored by Méven Car's avatar Méven Car
Browse files

When receiving a list of files as parameters, filter duplicate filenames

BUG: 434046
parent 3635f354
...@@ -92,8 +92,13 @@ public: ...@@ -92,8 +92,13 @@ public:
QList<QUrl> list; QList<QUrl> list;
QStringList tmpArgs = args; QStringList tmpArgs = args;
tmpArgs.removeDuplicates(); tmpArgs.removeDuplicates();
QStringList fileNames;
for (const QString & url : qAsConst(tmpArgs)) { for (const QString & url : qAsConst(tmpArgs)) {
list << QUrl::fromUserInput(url, QDir::currentPath(), QUrl::AssumeLocalFile); QUrl fileUrl = QUrl::fromUserInput(url, QDir::currentPath(), QUrl::AssumeLocalFile);
if (!fileNames.contains(fileUrl.fileName())) {
fileNames << fileUrl.fileName();
list <<fileUrl;
}
} }
KIO::CopyJob* job = KIO::link(list, mUrl); KIO::CopyJob* job = KIO::link(list, mUrl);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment