mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-01-10 14:57:52 +00:00
- Removed regular tracker scrape code since it is done automatically by libtorrent (it should not have been in GUI class anyway...)
- Moved bittorrent specific code from GUI class to bittorrent class
This commit is contained in:
parent
95469756d1
commit
0bc2e9aeeb
19
src/GUI.cpp
19
src/GUI.cpp
@ -234,9 +234,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
setWindowState(Qt::WindowMinimized);
|
setWindowState(Qt::WindowMinimized);
|
||||||
}
|
}
|
||||||
|
|
||||||
scrapeTimer = new QTimer(this);
|
|
||||||
connect(scrapeTimer, SIGNAL(timeout()), this, SLOT(scrapeTrackers()));
|
|
||||||
scrapeTimer->start(20000);
|
|
||||||
qDebug("GUI Built");
|
qDebug("GUI Built");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -244,12 +241,6 @@ GUI::GUI(QWidget *parent, QStringList torrentCmdLine) : QMainWindow(parent), dis
|
|||||||
GUI::~GUI() {
|
GUI::~GUI() {
|
||||||
qDebug("GUI destruction");
|
qDebug("GUI destruction");
|
||||||
hide();
|
hide();
|
||||||
// Do this as soon as possible
|
|
||||||
BTSession->saveDHTEntry();
|
|
||||||
BTSession->saveSessionState();
|
|
||||||
BTSession->saveFastResumeData();
|
|
||||||
scrapeTimer->stop();
|
|
||||||
delete scrapeTimer;
|
|
||||||
delete dlSpeedLbl;
|
delete dlSpeedLbl;
|
||||||
delete upSpeedLbl;
|
delete upSpeedLbl;
|
||||||
delete ratioLbl;
|
delete ratioLbl;
|
||||||
@ -310,16 +301,6 @@ void GUI::displayRSSTab(bool enable) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GUI::scrapeTrackers() {
|
|
||||||
std::vector<torrent_handle> torrents = BTSession->getTorrents();
|
|
||||||
std::vector<torrent_handle>::iterator torrentIT;
|
|
||||||
for(torrentIT = torrents.begin(); torrentIT != torrents.end(); torrentIT++) {
|
|
||||||
QTorrentHandle h = QTorrentHandle(*torrentIT);
|
|
||||||
if(!h.is_valid()) continue;
|
|
||||||
h.scrape_tracker();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void GUI::updateRatio() {
|
void GUI::updateRatio() {
|
||||||
// Update ratio info
|
// Update ratio info
|
||||||
float ratio = 1.;
|
float ratio = 1.;
|
||||||
|
@ -67,7 +67,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||||||
// Bittorrent
|
// Bittorrent
|
||||||
bittorrent *BTSession;
|
bittorrent *BTSession;
|
||||||
QTimer *checkConnect;
|
QTimer *checkConnect;
|
||||||
QTimer *scrapeTimer;
|
|
||||||
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers;
|
QList<QPair<QTorrentHandle,QString> > unauthenticated_trackers;
|
||||||
// GUI related
|
// GUI related
|
||||||
QTabWidget *tabs;
|
QTabWidget *tabs;
|
||||||
@ -153,7 +152,6 @@ class GUI : public QMainWindow, private Ui::MainWindow{
|
|||||||
void finishedTorrent(QTorrentHandle& h) const;
|
void finishedTorrent(QTorrentHandle& h) const;
|
||||||
//void updateLists(bool force=false);
|
//void updateLists(bool force=false);
|
||||||
bool initWebUi(QString username, QString password, int port);
|
bool initWebUi(QString username, QString password, int port);
|
||||||
void scrapeTrackers();
|
|
||||||
// Options slots
|
// Options slots
|
||||||
void on_actionOptions_triggered();
|
void on_actionOptions_triggered();
|
||||||
void optionsSaved();
|
void optionsSaved();
|
||||||
|
@ -104,10 +104,9 @@ bittorrent::bittorrent() : DHTEnabled(false), preAllocateAll(false), addInPause(
|
|||||||
bittorrent::~bittorrent() {
|
bittorrent::~bittorrent() {
|
||||||
qDebug("BTSession deletion");
|
qDebug("BTSession deletion");
|
||||||
// Do some BT related saving
|
// Do some BT related saving
|
||||||
// XXX: Done in GUI now (earlier = safer)
|
saveDHTEntry();
|
||||||
/*saveDHTEntry();
|
|
||||||
saveSessionState();
|
saveSessionState();
|
||||||
tResumeData();*/
|
saveFastResumeData();
|
||||||
// Disable directory scanning
|
// Disable directory scanning
|
||||||
disableDirectoryScanning();
|
disableDirectoryScanning();
|
||||||
// Delete our objects
|
// Delete our objects
|
||||||
|
Loading…
Reference in New Issue
Block a user