mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-16 02:03:07 -07:00
Fix several signals/slots bindings
Drop backward compatiblity functions for qBT <= 1.4.0 Clean up torrent loading code (Use priority queue instead of insertion sort)
This commit is contained in:
parent
e082c02630
commit
bea3c33a46
5 changed files with 23 additions and 276 deletions
|
@ -156,7 +156,7 @@ TransferListWidget::~TransferListWidget() {
|
|||
delete listDelegate;
|
||||
}
|
||||
|
||||
void TransferListWidget::addTorrent(const QTorrentHandle& h) {
|
||||
void TransferListWidget::addTorrent(QTorrentHandle& h) {
|
||||
if(!h.is_valid()) return;
|
||||
// Check that the torrent is not already there
|
||||
if(getRowFromHash(h.hash()) >= 0) return;
|
||||
|
@ -235,7 +235,7 @@ void TransferListWidget::deleteTorrent(int row, bool refresh_list) {
|
|||
}
|
||||
|
||||
// Wrapper slot for bittorrent signal
|
||||
void TransferListWidget::pauseTorrent(const QTorrentHandle &h) {
|
||||
void TransferListWidget::pauseTorrent(QTorrentHandle &h) {
|
||||
pauseTorrent(getRowFromHash(h.hash()));
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ int TransferListWidget::getNbTorrents() const {
|
|||
}
|
||||
|
||||
// Wrapper slot for bittorrent signal
|
||||
void TransferListWidget::resumeTorrent(const QTorrentHandle &h) {
|
||||
void TransferListWidget::resumeTorrent(QTorrentHandle &h) {
|
||||
resumeTorrent(getRowFromHash(h.hash()));
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ void TransferListWidget::resumeTorrent(int row, bool refresh_list) {
|
|||
refreshList();
|
||||
}
|
||||
|
||||
void TransferListWidget::updateMetadata(const QTorrentHandle &h) {
|
||||
void TransferListWidget::updateMetadata(QTorrentHandle &h) {
|
||||
const QString &hash = h.hash();
|
||||
const int row = getRowFromHash(hash);
|
||||
if(row != -1) {
|
||||
|
@ -440,7 +440,7 @@ int TransferListWidget::updateTorrent(int row) {
|
|||
return s;
|
||||
}
|
||||
|
||||
void TransferListWidget::setFinished(const QTorrentHandle &h) {
|
||||
void TransferListWidget::setFinished(QTorrentHandle &h) {
|
||||
const int row = getRowFromHash(h.hash());
|
||||
try {
|
||||
if(row >= 0) {
|
||||
|
@ -482,7 +482,7 @@ void TransferListWidget::refreshList() {
|
|||
std::vector<torrent_handle> torrents = BTSession->getSession()->get_torrents();
|
||||
std::vector<torrent_handle>::iterator itr;
|
||||
for(itr = torrents.begin(); itr != torrents.end(); itr++) {
|
||||
const QTorrentHandle &h(*itr);
|
||||
QTorrentHandle h(*itr);
|
||||
if(h.is_valid() && getRowFromHash(h.hash()) < 0) {
|
||||
addTorrent(h);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue