Browse Source

Use a proper error icon for seeding torrents whose files have been removed from hard drive (manually)

adaptive-webui-19844
Christophe Dumez 15 years ago
parent
commit
f3066b07b5
  1. 2
      src/bittorrent.cpp
  2. 7
      src/transferlistwidget.cpp

2
src/bittorrent.cpp

@ -2286,8 +2286,8 @@ void Bittorrent::addConsoleMessage(QString msg, QString) { @@ -2286,8 +2286,8 @@ void Bittorrent::addConsoleMessage(QString msg, QString) {
const QString hash = h.hash();
// Mismatching file size (files were probably moved
addConsoleMessage(tr("File sizes mismatch for torrent %1, pausing it.").arg(h.name()));
pauseTorrent(hash);
TorrentPersistentData::setErrorState(hash, true);
pauseTorrent(hash);
} else {
addConsoleMessage(tr("Fast resume data was rejected for torrent %1, checking again...").arg(h.name()), QString::fromUtf8("red"));
addConsoleMessage(tr("Reason: %1").arg(misc::toQString(p->message())));

7
src/transferlistwidget.cpp

@ -191,6 +191,9 @@ void TransferListWidget::addTorrent(QTorrentHandle& h) { @@ -191,6 +191,9 @@ void TransferListWidget::addTorrent(QTorrentHandle& h) {
} else {
listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_DL);
}
if(TorrentPersistentData::hasError(h.hash()))
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/error.png"))), Qt::DecorationRole);
else
listModel->setData(listModel->index(row, TR_NAME), QVariant(QIcon(QString::fromUtf8(":/Icons/skin/paused.png"))), Qt::DecorationRole);
setRowColor(row, QString::fromUtf8("red"));
}else{
@ -250,7 +253,7 @@ void TransferListWidget::pauseTorrent(int row, bool refresh_list) { @@ -250,7 +253,7 @@ void TransferListWidget::pauseTorrent(int row, bool refresh_list) {
listModel->setData(listModel->index(row, TR_UPSPEED), QVariant((double)0.0));
if(h.is_seed()) {
listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_UP);
if(h.has_error()) {
if(h.has_error() || TorrentPersistentData::hasError(h.hash())) {
listModel->setData(listModel->index(row, TR_NAME), h.error(), Qt::ToolTipRole);
listModel->setData(listModel->index(row, TR_NAME), QIcon(QString::fromUtf8(":/Icons/skin/error.png")), Qt::DecorationRole);
} else {
@ -258,7 +261,7 @@ void TransferListWidget::pauseTorrent(int row, bool refresh_list) { @@ -258,7 +261,7 @@ void TransferListWidget::pauseTorrent(int row, bool refresh_list) {
}
} else {
listModel->setData(listModel->index(row, TR_STATUS), STATE_PAUSED_DL);
if(h.has_error()) {
if(h.has_error() || TorrentPersistentData::hasError(h.hash())) {
listModel->setData(listModel->index(row, TR_NAME), h.error(), Qt::ToolTipRole);
listModel->setData(listModel->index(row, TR_NAME), QIcon(QString::fromUtf8(":/Icons/skin/error.png")), Qt::DecorationRole);
} else {

Loading…
Cancel
Save