diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp index 5aa195373..957b61f7f 100644 --- a/retroshare-gui/src/gui/RetroShareLink.cpp +++ b/retroshare-gui/src/gui/RetroShareLink.cpp @@ -1587,46 +1587,8 @@ void RSLinkClipboard::parseClipboard(QList &links) { // parse clipboard for links. // - links.clear(); QString text = QApplication::clipboard()->text() ; - - std::cerr << "Parsing clipboard:" << text.toStdString() << std::endl ; - - QRegExp rx(QString("retroshare://(%1)[^\r\n]+").arg(HOST_REGEXP)); - - int pos = 0; - - while((pos = rx.indexIn(text, pos)) != -1) - { - QString url(text.mid(pos, rx.matchedLength())); - RetroShareLink link(url); - - if(link.valid()) - { - // check that the link is not already in the list: - bool already = false ; - for (int i = 0; i &links) +{ + links.clear(); + + std::cerr << "Parsing text:" << text.toStdString() << std::endl ; + + QRegExp rx(QString("retroshare://(%1)[^\r\n]+").arg(HOST_REGEXP)); + + int pos = 0; + + while((pos = rx.indexIn(text, pos)) != -1) + { + QString url(text.mid(pos, rx.matchedLength())); + RetroShareLink link(url); + + if(link.valid()) + { + // check that the link is not already in the list: + bool already = false ; + for (int i = 0; i &links) ; + private: static void parseClipboard(QList &links) ; }; diff --git a/retroshare-gui/src/gui/common/MimeTextEdit.cpp b/retroshare-gui/src/gui/common/MimeTextEdit.cpp index 79ae8de56..5ff657ce3 100644 --- a/retroshare-gui/src/gui/common/MimeTextEdit.cpp +++ b/retroshare-gui/src/gui/common/MimeTextEdit.cpp @@ -78,6 +78,17 @@ void MimeTextEdit::insertFromMimeData(const QMimeData* source) } #endif + //insert retroshare links + QList links; + RSLinkClipboard::parseText(source->text(), links); + if(links.size() > 0) + { + for(int i = 0; i < links.size(); ++i) + insertHtml(links[i].toHtml() + "
"); + + return; + } + return RSTextEdit::insertFromMimeData(source); }