diff --git a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp index b284fce3d..d6446b823 100644 --- a/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp +++ b/retroshare-gui/src/gui/FileTransfer/SearchDialog.cpp @@ -1457,7 +1457,8 @@ void SearchDialog::copyResultLink() QList itemsForCopy = ui.searchResultWidget->selectedItems(); QTreeWidgetItem * item; - std::map url_map; + std::set already_seen_hashes; + QList urls ; for (auto item:itemsForCopy) { @@ -1466,7 +1467,7 @@ void SearchDialog::copyResultLink() QString fhash = item->text(SR_HASH_COL); RsFileHash hash(fhash.toStdString()); - if(!hash.isNull()) + if(!hash.isNull() && (already_seen_hashes.end() == already_seen_hashes.find(hash))) { std::cerr << "SearchDialog::copyResultLink() Calling set retroshare link"; std::cerr << std::endl; @@ -1477,16 +1478,13 @@ void SearchDialog::copyResultLink() RetroShareLink link = RetroShareLink::createFile(fname, fsize, fhash); if (link.valid()) - url_map[hash] = link; + { + std::cerr << "new link added to clipboard: " << link.toString().toStdString() << std::endl ; + urls.push_back(link); + already_seen_hashes.insert(hash); + } } } - QList urls ; - - for(auto link:url_map) - { - std::cerr << "new link added to clipboard: " << link.second.toString().toStdString() << std::endl ; - urls.push_back(link.second); - } RSLinkClipboard::copyLinks(urls) ; }