diff --git a/Changelog b/Changelog index 09140703b..49d508506 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,7 @@ * Unknown - Christophe Dumez - v1.5.0 - FEATURE: Added Magnet URI support - FEATURE: Display free disk space in torrent addition dialog + - FEATURE: In torrent addition from URL, paste clipboard content if it contains an URL - BUGFIX: torrent resume code rewrited * Thu Aug 13 2009 - Christophe Dumez - v1.4.0 diff --git a/src/downloadFromURLImp.h b/src/downloadFromURLImp.h index ff58a00dc..49934f45f 100644 --- a/src/downloadFromURLImp.h +++ b/src/downloadFromURLImp.h @@ -36,6 +36,7 @@ #include #include #include +#include #include "ui_downloadFromURL.h" class downloadFromURL : public QDialog, private Ui::downloadFromURL{ @@ -47,6 +48,11 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{ setAttribute(Qt::WA_DeleteOnClose); icon_lbl->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/url.png"))); show(); + // Paste clipboard if there is an URL in it + QString clip_txt = qApp->clipboard()->text(); + if(clip_txt.startsWith("http://", Qt::CaseInsensitive) || clip_txt.startsWith("https://", Qt::CaseInsensitive) || clip_txt.startsWith("ftp://", Qt::CaseInsensitive) || clip_txt.startsWith("magnet:", Qt::CaseInsensitive)) { + textUrls->setText(clip_txt); + } } ~downloadFromURL(){}