From 2e2bf321f3f6615687e2017964dbbf8816607b31 Mon Sep 17 00:00:00 2001 From: jisopo Date: Sat, 24 Jan 2026 10:13:25 +0300 Subject: [PATCH] filter torrent by commentary --- src/gui/mainwindow.cpp | 2 +- src/gui/transferlistmodel.cpp | 3 +++ src/gui/transferlistmodel.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 978004e1c48b..ef26fcd78dce 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -262,7 +262,7 @@ MainWindow::MainWindow(IGUIApplication *app, const WindowState initialState, con #endif tr("Transfers")); // Filter types - const QList filterTypes = {TransferListModel::Column::TR_NAME, TransferListModel::Column::TR_SAVE_PATH}; + const QList filterTypes = {TransferListModel::Column::TR_NAME, TransferListModel::Column::TR_SAVE_PATH, TransferListModel::Column::TR_COMMENT}; for (const TransferListModel::Column type : filterTypes) { const QString typeName = m_transferListWidget->getSourceModel()->headerData(type, Qt::Horizontal, Qt::DisplayRole).value(); diff --git a/src/gui/transferlistmodel.cpp b/src/gui/transferlistmodel.cpp index ba619aebe1b3..88e6a9b445be 100644 --- a/src/gui/transferlistmodel.cpp +++ b/src/gui/transferlistmodel.cpp @@ -183,6 +183,7 @@ QVariant TransferListModel::headerData(const int section, const Qt::Orientation case TR_AMOUNT_LEFT: return tr("Remaining", "Amount of data left to download (e.g. in MB)"); case TR_TIME_ELAPSED: return tr("Time Active", "Time (duration) the torrent is active (not stopped)"); case TR_SAVE_PATH: return tr("Save Path", "Torrent save path"); + case TR_COMMENT: return tr("Commentary", "Torrent commentary"); case TR_DOWNLOAD_PATH: return tr("Incomplete Save Path", "Torrent incomplete save path"); case TR_COMPLETED: return tr("Completed", "Amount of data completed (e.g. in MB)"); case TR_RATIO_LIMIT: return tr("Ratio Limit", "Upload share ratio limit"); @@ -423,6 +424,8 @@ QString TransferListModel::displayValue(const BitTorrent::Torrent *torrent, cons return timeElapsedString(torrent->activeTime(), torrent->finishedTime()); case TR_SAVE_PATH: return torrent->savePath().toString(); + case TR_COMMENT: + return torrent->comment(); case TR_DOWNLOAD_PATH: return torrent->downloadPath().toString(); case TR_COMPLETED: diff --git a/src/gui/transferlistmodel.h b/src/gui/transferlistmodel.h index 6034e49406a5..ded94472a6b1 100644 --- a/src/gui/transferlistmodel.h +++ b/src/gui/transferlistmodel.h @@ -87,6 +87,7 @@ class TransferListModel final : public QAbstractListModel TR_INFOHASH_V2, TR_REANNOUNCE, TR_PRIVATE, + TR_COMMENT, NB_COLUMNS };