Browse Source

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

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
2477dc1fc0
  1. 1
      Changelog
  2. 6
      src/downloadFromURLImp.h

1
Changelog

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
* Unknown - Christophe Dumez <chris@qbittorrent.org> - 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 <chris@qbittorrent.org> - v1.4.0

6
src/downloadFromURLImp.h

@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
#include <QString>
#include <QRegExp>
#include <QStringList>
#include <QClipboard>
#include "ui_downloadFromURL.h"
class downloadFromURL : public QDialog, private Ui::downloadFromURL{
@ -47,6 +48,11 @@ 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(){}

Loading…
Cancel
Save