Don't use deprecated torrent_handle::set_tracker_login

This commit is contained in:
Vladimir Golovnev (Glassez)
2017-05-01 20:27:07 +03:00
parent 1d3dbcb9d2
commit a4d2df575e
4 changed files with 15 additions and 1 deletions

View File

@@ -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 QPair<BitTorrent::TorrentHandle
// Called when a tracker requires authentication
void MainWindow::trackerAuthenticationRequired(BitTorrent::TorrentHandle *const torrent)
{
#if LIBTORRENT_VERSION_NUM < 10100
if (m_unauthenticatedTrackers.indexOf(qMakePair(torrent, torrent->currentTracker())) < 0)
// Tracker login
new trackerLogin(this, torrent);
#else
Q_UNUSED(torrent);
#endif
}
// Check connection status and display right icon

View File

@@ -28,9 +28,11 @@
* Contact : chris@qbittorrent.org
*/
#include "base/bittorrent/torrenthandle.h"
#include "trackerlogin.h"
#include <libtorrent/version.hpp>
#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();
}