- FEATURE: In torrent addition from URL, paste clipboard content if it contains an URL

This commit is contained in:
Christophe Dumez 2009-08-18 03:29:34 +00:00
parent 706362333d
commit 2477dc1fc0
2 changed files with 7 additions and 0 deletions

View file

@ -1,6 +1,7 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.5.0 * Unknown - Christophe Dumez <chris@qbittorrent.org> - v1.5.0
- FEATURE: Added Magnet URI support - FEATURE: Added Magnet URI support
- FEATURE: Display free disk space in torrent addition dialog - 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 - BUGFIX: torrent resume code rewrited
* Thu Aug 13 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.0 * Thu Aug 13 2009 - Christophe Dumez <chris@qbittorrent.org> - v1.4.0

View file

@ -36,6 +36,7 @@
#include <QString> #include <QString>
#include <QRegExp> #include <QRegExp>
#include <QStringList> #include <QStringList>
#include <QClipboard>
#include "ui_downloadFromURL.h" #include "ui_downloadFromURL.h"
class downloadFromURL : public QDialog, private Ui::downloadFromURL{ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
@ -47,6 +48,11 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL{
setAttribute(Qt::WA_DeleteOnClose); setAttribute(Qt::WA_DeleteOnClose);
icon_lbl->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/url.png"))); icon_lbl->setPixmap(QPixmap(QString::fromUtf8(":/Icons/skin/url.png")));
show(); 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(){} ~downloadFromURL(){}