From a4d2df575e9fef8b53c21566f0d7d85cc94af225 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Mon, 1 May 2017 20:27:07 +0300 Subject: [PATCH] Don't use deprecated torrent_handle::set_tracker_login --- src/base/bittorrent/torrenthandle.cpp | 2 ++ src/base/bittorrent/torrenthandle.h | 2 ++ src/gui/mainwindow.cpp | 6 ++++++ src/gui/trackerlogin.cpp | 6 +++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index 386ca8ba4..b615ba7f9 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -1331,11 +1331,13 @@ void TorrentHandle::moveStorage(const QString &newPath) } } +#if LIBTORRENT_VERSION_NUM < 10100 void TorrentHandle::setTrackerLogin(const QString &username, const QString &password) { m_nativeHandle.set_tracker_login(std::string(username.toLocal8Bit().constData()) , std::string(password.toLocal8Bit().constData())); } +#endif void TorrentHandle::renameFile(int index, const QString &name) { diff --git a/src/base/bittorrent/torrenthandle.h b/src/base/bittorrent/torrenthandle.h index 0e057f24d..b24f633cb 100644 --- a/src/base/bittorrent/torrenthandle.h +++ b/src/base/bittorrent/torrenthandle.h @@ -333,7 +333,9 @@ namespace BitTorrent void forceReannounce(int index = -1); void forceDHTAnnounce(); void forceRecheck(); +#if LIBTORRENT_VERSION_NUM < 10100 void setTrackerLogin(const QString &username, const QString &password); +#endif void renameFile(int index, const QString &name); bool saveTorrentFile(const QString &path); void prioritizeFiles(const QVector &priorities); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 9632e2988..459839f3b 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -91,7 +91,9 @@ #include "rss/rsswidget.h" #include "about_imp.h" #include "optionsdlg.h" +#if LIBTORRENT_VERSION_NUM < 10100 #include "trackerlogin.h" +#endif #include "lineedit.h" #include "executionlog.h" #include "hidabletabwidget.h" @@ -1311,9 +1313,13 @@ void MainWindow::addUnauthenticatedTracker(const QPaircurrentTracker())) < 0) // Tracker login new trackerLogin(this, torrent); +#else + Q_UNUSED(torrent); +#endif } // Check connection status and display right icon diff --git a/src/gui/trackerlogin.cpp b/src/gui/trackerlogin.cpp index 9ff21cad4..74abf1dae 100644 --- a/src/gui/trackerlogin.cpp +++ b/src/gui/trackerlogin.cpp @@ -28,9 +28,11 @@ * Contact : chris@qbittorrent.org */ -#include "base/bittorrent/torrenthandle.h" #include "trackerlogin.h" +#include +#include "base/bittorrent/torrenthandle.h" + trackerLogin::trackerLogin(QWidget *parent, BitTorrent::TorrentHandle *const torrent) : QDialog(parent) , m_torrent(torrent) @@ -47,7 +49,9 @@ trackerLogin::~trackerLogin() {} void trackerLogin::on_loginButton_clicked() { // login +#if LIBTORRENT_VERSION_NUM < 10100 m_torrent->setTrackerLogin(lineUsername->text(), linePasswd->text()); +#endif close(); }