BUGFIX: Correctly update total number of torrents when a torrent is automatically removed (closes #668726)

This commit is contained in:
Christophe Dumez
2010-10-30 13:59:07 +00:00
parent ecdfe63d00
commit b70cf7c049
5 changed files with 13 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
- BUGFIX: Fix crash when pressing enter in save path field in torrent addition dialog
- BUGFIX: Fix crash when deleting a torrent with no metadata (closes #667528)
- BUGFIX: Fix possible crash on clicking a RSS article (closes #575624)
- BUGFIX: Correctly update total number of torrents when a torrent is automatically removed (closes #668726)
- BUGFIX: Correctly display the hash of torrents with no metadata
- BUGFIX: Elide status bar text if it is too wide

View File

@@ -32,6 +32,7 @@
#include <QStringList>
#include <QFile>
#include <QDir>
#include <QDebug>
#include <QByteArray>
#include <math.h>
#include "misc.h"
@@ -755,6 +756,7 @@ void QTorrentHandle::add_tracker(const announce_entry& url) {
}
void QTorrentHandle::prioritize_first_last_piece(bool b) {
qDebug() << Q_FUNC_INFO << b;
Q_ASSERT(h.is_valid());
// Detect main file
int rank=0;

View File

@@ -3,7 +3,7 @@ LANG_PATH = lang
ICONS_PATH = Icons
# Set the following variable to 1 to enable debug
DEBUG_MODE = 0
DEBUG_MODE = 1
# Global
TEMPLATE = app

View File

@@ -140,6 +140,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, GUI *main_window, Bittor
connect(BTSession, SIGNAL(pausedTorrent(QTorrentHandle&)), this, SLOT(pauseTorrent(QTorrentHandle&)));
connect(BTSession, SIGNAL(resumedTorrent(QTorrentHandle&)), this, SLOT(resumeTorrent(QTorrentHandle&)));
connect(BTSession, SIGNAL(torrentFinishedChecking(QTorrentHandle&)), this, SLOT(updateMetadata(QTorrentHandle&)));
connect(BTSession, SIGNAL(deletedTorrent(QString)), SLOT(deleteTorrent(QString)));
// Listen for list events
connect(this, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(torrentDoubleClicked(QModelIndex)));
@@ -255,6 +256,13 @@ void TransferListWidget::pauseTorrent(QTorrentHandle &h) {
pauseTorrent(getRowFromHash(h.hash()));
}
void TransferListWidget::deleteTorrent(QString hash) {
const int row = getRowFromHash(hash);
if(row >= 0) {
deleteTorrent(row, true);
}
}
void TransferListWidget::pauseTorrent(int row, bool refresh_list) {
const QTorrentHandle h = BTSession->getTorrentHandle(getHashFromRow(row));
listModel->setData(listModel->index(row, TR_DLSPEED), QVariant((double)0.0));

View File

@@ -103,6 +103,7 @@ protected:
protected slots:
int updateTorrent(int row);
void deleteTorrent(QString hash);
void deleteTorrent(int row, bool refresh_list=true);
void pauseTorrent(int row, bool refresh_list=true);
void resumeTorrent(int row, bool refresh_list=true);