|
|
@ -40,7 +40,6 @@ |
|
|
|
#include <QStandardItemModel> |
|
|
|
#include <QStandardItemModel> |
|
|
|
#include <QHeaderView> |
|
|
|
#include <QHeaderView> |
|
|
|
#include <QMenu> |
|
|
|
#include <QMenu> |
|
|
|
#include <QTimer> |
|
|
|
|
|
|
|
#include <QMessageBox> |
|
|
|
#include <QMessageBox> |
|
|
|
|
|
|
|
|
|
|
|
FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : parent(parent), BTSession(BTSession), nbFinished(0){ |
|
|
|
FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : parent(parent), BTSession(BTSession), nbFinished(0){ |
|
|
@ -95,33 +94,15 @@ FinishedTorrents::FinishedTorrents(QObject *parent, bittorrent *BTSession) : par |
|
|
|
connect(actionHOSColPeers, SIGNAL(triggered()), this, SLOT(hideOrShowColumnPeers())); |
|
|
|
connect(actionHOSColPeers, SIGNAL(triggered()), this, SLOT(hideOrShowColumnPeers())); |
|
|
|
connect(actionHOSColUpload, SIGNAL(triggered()), this, SLOT(hideOrShowColumnUpload())); |
|
|
|
connect(actionHOSColUpload, SIGNAL(triggered()), this, SLOT(hideOrShowColumnUpload())); |
|
|
|
connect(actionHOSColRatio, SIGNAL(triggered()), this, SLOT(hideOrShowColumnRatio())); |
|
|
|
connect(actionHOSColRatio, SIGNAL(triggered()), this, SLOT(hideOrShowColumnRatio())); |
|
|
|
|
|
|
|
|
|
|
|
scrapeTimer = new QTimer(this); |
|
|
|
|
|
|
|
connect(scrapeTimer, SIGNAL(timeout()), this, SLOT(scrapeTrackers())); |
|
|
|
|
|
|
|
scrapeTimer->start(20000); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
FinishedTorrents::~FinishedTorrents(){ |
|
|
|
FinishedTorrents::~FinishedTorrents(){ |
|
|
|
saveColWidthFinishedList(); |
|
|
|
saveColWidthFinishedList(); |
|
|
|
saveHiddenColumns(); |
|
|
|
saveHiddenColumns(); |
|
|
|
scrapeTimer->stop(); |
|
|
|
|
|
|
|
delete scrapeTimer; |
|
|
|
|
|
|
|
delete finishedListDelegate; |
|
|
|
delete finishedListDelegate; |
|
|
|
delete finishedListModel; |
|
|
|
delete finishedListModel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void FinishedTorrents::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; |
|
|
|
|
|
|
|
if(h.is_seed()) { |
|
|
|
|
|
|
|
h.scrape_tracker(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void FinishedTorrents::notifyTorrentDoubleClicked(const QModelIndex& index) { |
|
|
|
void FinishedTorrents::notifyTorrentDoubleClicked(const QModelIndex& index) { |
|
|
|
unsigned int row = index.row(); |
|
|
|
unsigned int row = index.row(); |
|
|
|
QString hash = getHashFromRow(row); |
|
|
|
QString hash = getHashFromRow(row); |
|
|
|