Cache file priorities

Speedup access to file priorities by avoiding extra blocking call to libtorrent thread.
Improve the Torrent interface by hiding the asynchrony of file priority changes behind the scenes.

PR #16425.
This commit is contained in:
Vladimir Golovnev
2022-02-13 08:07:30 +03:00
committed by GitHub
parent 78eaa49cd6
commit c3a64b3d6c
2 changed files with 29 additions and 21 deletions

View File

@@ -272,7 +272,7 @@ namespace BitTorrent
void adjustStorageLocation();
void moveStorage(const Path &newPath, MoveStorageMode mode);
void manageIncompleteFiles();
void applyFirstLastPiecePriority(bool enabled, const QVector<DownloadPriority> &updatedFilePrio = {});
void applyFirstLastPiecePriority(bool enabled);
void prepareResumeData(const lt::add_torrent_params &params);
void endReceivedMetadataHandling(const Path &savePath, const PathList &fileNames);
@@ -286,6 +286,7 @@ namespace BitTorrent
TorrentInfo m_torrentInfo;
PathList m_filePaths;
QHash<lt::file_index_t, int> m_indexMap;
QVector<DownloadPriority> m_filePriorities;
SpeedMonitor m_speedMonitor;
InfoHash m_infoHash;