Browse Source

- Added support for magnet links in search engine. Most search Web sites provides magnet links now and in the futures, they may provide only the magnet links.

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
88c56d8250
  1. 1
      Changelog
  2. 2
      src/GUI.h
  3. 6
      src/searchengine.cpp

1
Changelog

@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
- FEATURE: Torrents can be renamed in transfer list
- FEATURE: Display torrent addition dialog for magnet links too
- FEATURE: Files contained in a torrent are opened on double click (files panel)
- FEATURE: Added support for magnet links in search engine
- BUGFIX: Use XDG folders (.cache, .local) instead of .qbittorrent
- COSMETIC: Use checkboxes to filter torrent content instead of comboboxes
- COSMETIC: Use alternating row colors in transfer list (set in program preferences)

2
src/GUI.h

@ -130,7 +130,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{ @@ -130,7 +130,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{
void addTorrent(QString path);
void addUnauthenticatedTracker(QPair<QTorrentHandle,QString> tracker);
void processDownloadedFiles(QString path, QString url);
void downloadFromURLList(const QStringList& urls);
void finishedTorrent(QTorrentHandle& h) const;
// Options slots
void on_actionOptions_triggered();
@ -143,6 +142,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{ @@ -143,6 +142,7 @@ class GUI : public QMainWindow, private Ui::MainWindow{
void trackerAuthenticationRequired(QTorrentHandle& h);
void setTabText(int index, QString text) const;
void showNotificationBaloon(QString title, QString msg) const;
void downloadFromURLList(const QStringList& urls);
protected:
void closeEvent(QCloseEvent *);

6
src/searchengine.cpp

@ -301,6 +301,11 @@ void SearchEngine::saveResultsColumnsWidth() { @@ -301,6 +301,11 @@ void SearchEngine::saveResultsColumnsWidth() {
}
void SearchEngine::downloadTorrent(QString engine_url, QString torrent_url) {
if(torrent_url.startsWith("magnet:")) {
QStringList urls;
urls << torrent_url;
parent->downloadFromURLList(urls);
} else {
QProcess *downloadProcess = new QProcess(this);
connect(downloadProcess, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(downloadFinished(int,QProcess::ExitStatus)));
downloaders << downloadProcess;
@ -311,6 +316,7 @@ void SearchEngine::downloadTorrent(QString engine_url, QString torrent_url) { @@ -311,6 +316,7 @@ void SearchEngine::downloadTorrent(QString engine_url, QString torrent_url) {
// Launch search
downloadProcess->start("python", params, QIODevice::ReadOnly);
}
}
void SearchEngine::searchStarted(){
// Update SearchEngine widgets

Loading…
Cancel
Save