Browse Source

Don't use deprecated torrent_handle::set_tracker_login

adaptive-webui-19844
Vladimir Golovnev (Glassez) 8 years ago
parent
commit
a4d2df575e
  1. 2
      src/base/bittorrent/torrenthandle.cpp
  2. 2
      src/base/bittorrent/torrenthandle.h
  3. 6
      src/gui/mainwindow.cpp
  4. 6
      src/gui/trackerlogin.cpp

2
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) void TorrentHandle::setTrackerLogin(const QString &username, const QString &password)
{ {
m_nativeHandle.set_tracker_login(std::string(username.toLocal8Bit().constData()) m_nativeHandle.set_tracker_login(std::string(username.toLocal8Bit().constData())
, std::string(password.toLocal8Bit().constData())); , std::string(password.toLocal8Bit().constData()));
} }
#endif
void TorrentHandle::renameFile(int index, const QString &name) void TorrentHandle::renameFile(int index, const QString &name)
{ {

2
src/base/bittorrent/torrenthandle.h

@ -333,7 +333,9 @@ namespace BitTorrent
void forceReannounce(int index = -1); void forceReannounce(int index = -1);
void forceDHTAnnounce(); void forceDHTAnnounce();
void forceRecheck(); void forceRecheck();
#if LIBTORRENT_VERSION_NUM < 10100
void setTrackerLogin(const QString &username, const QString &password); void setTrackerLogin(const QString &username, const QString &password);
#endif
void renameFile(int index, const QString &name); void renameFile(int index, const QString &name);
bool saveTorrentFile(const QString &path); bool saveTorrentFile(const QString &path);
void prioritizeFiles(const QVector<int> &priorities); void prioritizeFiles(const QVector<int> &priorities);

6
src/gui/mainwindow.cpp

@ -91,7 +91,9 @@
#include "rss/rsswidget.h" #include "rss/rsswidget.h"
#include "about_imp.h" #include "about_imp.h"
#include "optionsdlg.h" #include "optionsdlg.h"
#if LIBTORRENT_VERSION_NUM < 10100
#include "trackerlogin.h" #include "trackerlogin.h"
#endif
#include "lineedit.h" #include "lineedit.h"
#include "executionlog.h" #include "executionlog.h"
#include "hidabletabwidget.h" #include "hidabletabwidget.h"
@ -1311,9 +1313,13 @@ void MainWindow::addUnauthenticatedTracker(const QPair<BitTorrent::TorrentHandle
// Called when a tracker requires authentication // Called when a tracker requires authentication
void MainWindow::trackerAuthenticationRequired(BitTorrent::TorrentHandle *const torrent) void MainWindow::trackerAuthenticationRequired(BitTorrent::TorrentHandle *const torrent)
{ {
#if LIBTORRENT_VERSION_NUM < 10100
if (m_unauthenticatedTrackers.indexOf(qMakePair(torrent, torrent->currentTracker())) < 0) if (m_unauthenticatedTrackers.indexOf(qMakePair(torrent, torrent->currentTracker())) < 0)
// Tracker login // Tracker login
new trackerLogin(this, torrent); new trackerLogin(this, torrent);
#else
Q_UNUSED(torrent);
#endif
} }
// Check connection status and display right icon // Check connection status and display right icon

6
src/gui/trackerlogin.cpp

@ -28,9 +28,11 @@
* Contact : chris@qbittorrent.org * Contact : chris@qbittorrent.org
*/ */
#include "base/bittorrent/torrenthandle.h"
#include "trackerlogin.h" #include "trackerlogin.h"
#include <libtorrent/version.hpp>
#include "base/bittorrent/torrenthandle.h"
trackerLogin::trackerLogin(QWidget *parent, BitTorrent::TorrentHandle *const torrent) trackerLogin::trackerLogin(QWidget *parent, BitTorrent::TorrentHandle *const torrent)
: QDialog(parent) : QDialog(parent)
, m_torrent(torrent) , m_torrent(torrent)
@ -47,7 +49,9 @@ trackerLogin::~trackerLogin() {}
void trackerLogin::on_loginButton_clicked() { void trackerLogin::on_loginButton_clicked() {
// login // login
#if LIBTORRENT_VERSION_NUM < 10100
m_torrent->setTrackerLogin(lineUsername->text(), linePasswd->text()); m_torrent->setTrackerLogin(lineUsername->text(), linePasswd->text());
#endif
close(); close();
} }

Loading…
Cancel
Save