Added 'Ratio Limit' column. Closes #936.

This commit is contained in:
sledgehammer999
2014-08-14 20:46:55 +03:00
parent e0190d5576
commit e294b2f456
5 changed files with 20 additions and 10 deletions

View File

@@ -260,6 +260,10 @@ QVariant TorrentModelItem::data(int column, int role) const
return fsutils::toNativePath(m_torrent.save_path_parsed());
case TR_COMPLETED:
return static_cast<qlonglong>(m_lastStatus.total_wanted_done);
case TR_RATIO_LIMIT: {
QString hash = misc::toQString(m_lastStatus.info_hash);
return QBtSession::instance()->getMaxRatioPerTorrent(hash, NULL);
}
default:
return QVariant();
}
@@ -335,6 +339,7 @@ QVariant TorrentModel::headerData(int section, Qt::Orientation orientation,
case TorrentModelItem::TR_TIME_ELAPSED: return tr("Time Active", "Time (duration) the torrent is active (not paused)");
case TorrentModelItem::TR_SAVE_PATH: return tr("Save path", "Torrent save path");
case TorrentModelItem::TR_COMPLETED: return tr("Completed", "Amount of data completed (e.g. in MB)");
case TorrentModelItem::TR_RATIO_LIMIT: return tr("Ratio Limit", "Upload share ratio limit");
default:
return QVariant();
}