Browse Source

Count magnet links in the 'downloading' filter and make them prevent system inhibition. Closes #1558

adaptive-webui-19844
sledgehammer999 11 years ago
parent
commit
5d2663660d
  1. 4
      src/qtlibtorrent/torrentmodel.cpp
  2. 2
      src/transferlistwidget.cpp

4
src/qtlibtorrent/torrentmodel.cpp

@ -428,6 +428,9 @@ TorrentStatusReport TorrentModel::getTorrentStatusReport() const
++report.nb_active; ++report.nb_active;
++report.nb_downloading; ++report.nb_downloading;
break; break;
case TorrentModelItem::STATE_DOWNLOADING_META:
++report.nb_downloading;
break;
case TorrentModelItem::STATE_PAUSED_DL: case TorrentModelItem::STATE_PAUSED_DL:
++report.nb_paused; ++report.nb_paused;
case TorrentModelItem::STATE_STALLED_DL: case TorrentModelItem::STATE_STALLED_DL:
@ -492,6 +495,7 @@ bool TorrentModel::inhibitSystem()
for ( ; it != itend; ++it) { for ( ; it != itend; ++it) {
switch((*it)->data(TorrentModelItem::TR_STATUS).toInt()) { switch((*it)->data(TorrentModelItem::TR_STATUS).toInt()) {
case TorrentModelItem::STATE_DOWNLOADING: case TorrentModelItem::STATE_DOWNLOADING:
case TorrentModelItem::STATE_DOWNLOADING_META:
case TorrentModelItem::STATE_STALLED_DL: case TorrentModelItem::STATE_STALLED_DL:
case TorrentModelItem::STATE_SEEDING: case TorrentModelItem::STATE_SEEDING:
case TorrentModelItem::STATE_STALLED_UP: case TorrentModelItem::STATE_STALLED_UP:

2
src/transferlistwidget.cpp

@ -921,7 +921,7 @@ void TransferListWidget::applyStatusFilter(int f) {
case FILTER_DOWNLOADING: case FILTER_DOWNLOADING:
statusFilterModel->setFilterRegExp(QRegExp(QString::number(TorrentModelItem::STATE_DOWNLOADING)+"|"+QString::number(TorrentModelItem::STATE_STALLED_DL)+"|"+ statusFilterModel->setFilterRegExp(QRegExp(QString::number(TorrentModelItem::STATE_DOWNLOADING)+"|"+QString::number(TorrentModelItem::STATE_STALLED_DL)+"|"+
QString::number(TorrentModelItem::STATE_PAUSED_DL)+"|"+QString::number(TorrentModelItem::STATE_CHECKING_DL)+"|"+ QString::number(TorrentModelItem::STATE_PAUSED_DL)+"|"+QString::number(TorrentModelItem::STATE_CHECKING_DL)+"|"+
QString::number(TorrentModelItem::STATE_QUEUED_DL), Qt::CaseSensitive)); QString::number(TorrentModelItem::STATE_QUEUED_DL)+"|"+QString::number(TorrentModelItem::STATE_DOWNLOADING_META), Qt::CaseSensitive));
break; break;
case FILTER_COMPLETED: case FILTER_COMPLETED:
statusFilterModel->setFilterRegExp(QRegExp(QString::number(TorrentModelItem::STATE_SEEDING)+"|"+QString::number(TorrentModelItem::STATE_STALLED_UP)+"|"+ statusFilterModel->setFilterRegExp(QRegExp(QString::number(TorrentModelItem::STATE_SEEDING)+"|"+QString::number(TorrentModelItem::STATE_STALLED_UP)+"|"+

Loading…
Cancel
Save