mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 13:53:37 -07:00
refactor: getFiles signature
This commit is contained in:
parent
965bcce312
commit
2d4b4af86b
1 changed files with 3 additions and 6 deletions
|
@ -278,7 +278,7 @@ namespace
|
||||||
return trackerList;
|
return trackerList;
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonArray getFiles(const BitTorrent::Torrent *const torrent, QList<int> &fileIndexes)
|
QJsonArray getFiles(const BitTorrent::Torrent *const torrent, QList<int> fileIndexes = {})
|
||||||
{
|
{
|
||||||
Q_ASSERT(torrent->hasMetadata());
|
Q_ASSERT(torrent->hasMetadata());
|
||||||
if (!torrent->hasMetadata()) [[unlikely]]
|
if (!torrent->hasMetadata()) [[unlikely]]
|
||||||
|
@ -416,10 +416,7 @@ void TorrentsController::infoAction()
|
||||||
QVariantMap serializedTorrent = serialize(*torrent);
|
QVariantMap serializedTorrent = serialize(*torrent);
|
||||||
|
|
||||||
if (includeFiles)
|
if (includeFiles)
|
||||||
{
|
serializedTorrent.insert(KEY_PROP_FILES, getFiles(torrent));
|
||||||
QList<int> fileIndexes;
|
|
||||||
serializedTorrent.insert(KEY_PROP_FILES, getFiles(torrent, fileIndexes));
|
|
||||||
}
|
|
||||||
if (includeTrackers)
|
if (includeTrackers)
|
||||||
serializedTorrent.insert(KEY_PROP_TRACKERS, getTrackers(torrent));
|
serializedTorrent.insert(KEY_PROP_TRACKERS, getTrackers(torrent));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue