diff --git a/src/qtlibtorrent/torrentmodel.cpp b/src/qtlibtorrent/torrentmodel.cpp index bb836baeb..12645a91b 100644 --- a/src/qtlibtorrent/torrentmodel.cpp +++ b/src/qtlibtorrent/torrentmodel.cpp @@ -258,6 +258,8 @@ QVariant TorrentModelItem::data(int column, int role) const return (role == Qt::DisplayRole) ? m_lastStatus.active_time : m_lastStatus.seeding_time; case TR_SAVE_PATH: return fsutils::toNativePath(m_torrent.save_path_parsed()); + case TR_COMPLETED: + return static_cast(m_lastStatus.total_wanted_done); default: return QVariant(); } @@ -332,6 +334,7 @@ QVariant TorrentModel::headerData(int section, Qt::Orientation orientation, case TorrentModelItem::TR_AMOUNT_LEFT: return tr("Remaining", "Amount of data left to download (e.g. in MB)"); 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)"); default: return QVariant(); } diff --git a/src/qtlibtorrent/torrentmodel.h b/src/qtlibtorrent/torrentmodel.h index 9eb14c52e..8540155d0 100644 --- a/src/qtlibtorrent/torrentmodel.h +++ b/src/qtlibtorrent/torrentmodel.h @@ -49,7 +49,7 @@ Q_OBJECT public: enum State {STATE_DOWNLOADING, STATE_DOWNLOADING_META, STATE_ALLOCATING, STATE_STALLED_DL, STATE_STALLED_UP, STATE_SEEDING, STATE_PAUSED_DL, STATE_PAUSED_UP, STATE_QUEUED_DL, STATE_QUEUED_UP, STATE_CHECKING_UP, STATE_CHECKING_DL, STATE_QUEUED_CHECK, STATE_QUEUED_FASTCHECK, STATE_INVALID}; - enum Column {TR_NAME, TR_PRIORITY, TR_SIZE, TR_PROGRESS, TR_STATUS, TR_SEEDS, TR_PEERS, TR_DLSPEED, TR_UPSPEED, TR_ETA, TR_RATIO, TR_LABEL, TR_ADD_DATE, TR_SEED_DATE, TR_TRACKER, TR_DLLIMIT, TR_UPLIMIT, TR_AMOUNT_DOWNLOADED, TR_AMOUNT_UPLOADED, TR_AMOUNT_LEFT, TR_TIME_ELAPSED, TR_SAVE_PATH, NB_COLUMNS}; + enum Column {TR_NAME, TR_PRIORITY, TR_SIZE, TR_PROGRESS, TR_STATUS, TR_SEEDS, TR_PEERS, TR_DLSPEED, TR_UPSPEED, TR_ETA, TR_RATIO, TR_LABEL, TR_ADD_DATE, TR_SEED_DATE, TR_TRACKER, TR_DLLIMIT, TR_UPLIMIT, TR_AMOUNT_DOWNLOADED, TR_AMOUNT_UPLOADED, TR_AMOUNT_LEFT, TR_TIME_ELAPSED, TR_SAVE_PATH, TR_COMPLETED, NB_COLUMNS}; public: TorrentModelItem(const QTorrentHandle& h); diff --git a/src/transferlistdelegate.h b/src/transferlistdelegate.h index e181a343f..17fe94da4 100644 --- a/src/transferlistdelegate.h +++ b/src/transferlistdelegate.h @@ -65,6 +65,7 @@ public: case TorrentModelItem::TR_AMOUNT_DOWNLOADED: case TorrentModelItem::TR_AMOUNT_UPLOADED: case TorrentModelItem::TR_AMOUNT_LEFT: + case TorrentModelItem::TR_COMPLETED: case TorrentModelItem::TR_SIZE:{ QItemDelegate::drawBackground(painter, opt, index); QItemDelegate::drawDisplay(painter, opt, option.rect, misc::friendlyUnit(index.data().toLongLong())); diff --git a/src/transferlistwidget.cpp b/src/transferlistwidget.cpp index 4e375df2e..ab3a980c4 100644 --- a/src/transferlistwidget.cpp +++ b/src/transferlistwidget.cpp @@ -124,6 +124,7 @@ TransferListWidget::TransferListWidget(QWidget *parent, MainWindow *main_window, setColumnHidden(TorrentModelItem::TR_AMOUNT_LEFT, true); setColumnHidden(TorrentModelItem::TR_TIME_ELAPSED, true); setColumnHidden(TorrentModelItem::TR_SAVE_PATH, true); + setColumnHidden(TorrentModelItem::TR_COMPLETED, true); } //Ensure that at least one column is visible at all times