Commit Graph

67 Commits

Author SHA1 Message Date
Antoine Cœur bdac708762
docs: fix various typos and misspellings (#2955) 2022-04-21 09:28:38 -05:00
Charles Kerr 18da7eb125
refactor: use std::vector<tr_quark> for torrent labels (#2942) 2022-04-18 00:53:48 -05:00
Charles Kerr e4461c48d7
refactor: prefer FMT_STRING (#2845)
* use FMT_STRING in libtr client on non-i18n strings

This gives compile-time safety checks.
2022-03-30 14:59:13 -05:00
Charles Kerr 4177e286a1
fix: sonarcloud (#2837)
* fix: rename variable to avoid shadow warning w/UTP

* fix: add default dtor for tr_strbuf

* fix: implicit conversion may lose precision

* fix: use init-statement to reduce variable scope

* fix: implicit conversion may lose precision

* fix: extract the assignment from this expression

* fix: use init-statement to reduce variable scope

* fix: use init-statement to reduce variable scope

* fix: do not mix public and private data members

* fix: add a condition to cv.wait call

* fix: do not throw uncaught exceptions in destructor
2022-03-29 05:57:04 -05:00
Charles Kerr 2f677aebb0
refactor: add tracer assertionf or bug #2727 (#2836) 2022-03-28 23:29:35 -05:00
Charles Kerr 2996e223dd
refactor: strbuf for metainfo files (#2833)
* refactor: tr_ctorSaveContents takes a string_view filename

* refactor: remove tr_ctorSaveMagnetContents

* refactor: announce_list::save takes a std::string_view

* refactor: magnet() takes an OutputIt arg

Generate the magnet link URL into an output iterator

* refactor: remove deprecated calls to tr_http_escape

* refactor: tr_torrent.torrentFile takes an OutputIterator

* refactor: tr_torrent.torrentFile returns a tr_pathbuf

* refactor: tr_torrent_metainfo.makeFilename returns a tr_pathbuf

* refactor: use tr_urlbuf in announcer-http
2022-03-28 17:13:32 -05:00
Charles Kerr 977b2a1bab
refactor: tr_loadFile() tr_saveFile() take a std::string_view filename arg (#2822)
* refactor: tr_saveFile takes a string_view

* refactor: tr_saveFile, tr_loadFile take string_view filename
2022-03-25 19:31:27 -05:00
Matan Ziv-Av c07bac4e19
Limit bandwidth used by a group of torrents (#2761)
* Add support for bandwidth groups. i.e. Bandwidth limit for a (user specified) group of torrents,
2022-03-18 08:11:59 -05:00
Charles Kerr 0be920156b
refactor: fmt part 3 (#2773) 2022-03-15 19:51:36 -05:00
Charles Kerr a942c67199
refactor: use fmt (#2758)
* deps: use fmt (8.1.1 tag) to build log strings

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-03-13 23:43:35 -05:00
Charles Kerr d2f8e1d4e0
refactor: set logging levels (#2755) 2022-03-11 15:09:22 -06:00
Charles Kerr 318d60b72d
refactor: fix sonarcloud "use enum class" code smells (#2590)
* refactor: prefer constexpr over enum for GUI_PAD values

* refactor: prefer constexpr over enum for PrefsDialog values

* refactor: prefer constexpr over enum for StatsDialog values

* refactor: use enum class for GtrUnicode types

* refactor: prefer constexpr over enum for BT peer msg codes

* refactor: use enum class for TrMakemetaResult

* refactor: prefer constexpr over enum for BT metadata message types

* refactor: use enum class for AwaitingBt

* refactor: use enum class for EncryptionPreference

* refactor: use enum class for TrFormat in rpcimpl

* refactor: prefer constexpr over enum for QApp intervals

* refactor: prefer constexpr over enum for tr_resume bitfields

* refactor: prefer constexpr over enum for Qt/TrFileModel bitfields

* refactor: remove obsolete TODO comment in announce-list
2022-02-08 20:25:19 -06:00
Charles Kerr ba14ffa74c
refactor: sonarcloud "use if init" statements (#2587) 2022-02-07 23:44:31 -06:00
Charles Kerr ebb2ab6aee
chore: update license spdx abbreviations (#2582)
Use SPDX license list 3.0 terminology: replace deprecated identifiers
GPL-2.0" and "GPL-3.0" with "GPL-3.0-only" and "GPL-3.0-only".
2022-02-07 10:25:02 -06:00
Charles Kerr ecef0feb0c
refactor: clang-tidy in libtransmission (#2578)
* chore: enable cppcoreguidelines-slicing warning

* chore: enable readability-named-parameter warning

* chore: enable bugprone-reserved-identifier check

* chore: enable bugprone-not-null-terminated-result check

* chore: enable bugprone-sizeof-expression check

* chore: enable bugprone-incorrect-roundings check

* chore: enable misc-misplaced-const check

* chore: enable bugprone-suspicious-include check

* chore: enable bugprone-signed-char-misuse check

* chore: enable modernize-raw-string-literal check

* chore: enable readability-static-accessed-through-instance check

* chore: enable readability-implicit-bool-conversion check

* fixup! Merge branch 'main' into refactor/clang-tidy
2022-02-06 22:28:36 -06:00
Charles Kerr e908193027
fix: some use-init-statement sonarcloud warnings (#2563) 2022-02-01 19:09:11 -06:00
Charles Kerr 878405f862
Revert "fix: sonarcloud (#2558)" (#2562)
This reverts commit 8b9483f7fb.
2022-02-01 11:30:51 -06:00
Charles Kerr 8b9483f7fb
fix: sonarcloud (#2558)
* fix: add const modifier for functions

* fix: many sonarcloud use-init-statement warnings
2022-01-31 22:46:27 -06:00
Charles Kerr 87dfabb9d2
refactor: replace tr_thread with std::thread (#2548) 2022-01-31 13:34:04 -06:00
Charles Kerr ac823f3cc4
fix: sonarcloud warnings in new code (#2500) 2022-01-24 19:05:24 -06:00
Charles Kerr df1cca9b57
chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Charles Kerr 8d75736ad1
fix: empty torrent filename (#2435)
fix torrents readded due to unremoved cfg files.
2022-01-17 23:14:00 -06:00
Charles Kerr aa2183c9c5
fix: torrents readded due to unremoved cfg files (#2433)
Fixes #2430.

When removing a torrent, try to remove config filenames under both old
and new filename formats. This prevents torrents from being incorrectly
re-added when old-format files aren't removed.
2022-01-17 20:36:41 -06:00
Charles Kerr db23ca4c6b
refactor: replace tr_info with tr_torrent_metainfo (#2397)
* refactor: replace tr_info with tr_torrent_metafo
2022-01-15 13:33:57 -06:00
Charles Kerr 7068eb66c1
refactor: migrate makeFilename() to tr_magnet_metainfo (#2385) 2022-01-08 21:03:21 -06:00
Charles Kerr 385a119fb1
refactor: make tr_torrent aggregates tr_block_info instead of subclassing (#2376) 2022-01-07 13:13:37 -06:00
Charles Kerr eafbf59832
refactor: avoid referencing tr_file struct directly (#2373) 2022-01-01 19:25:25 -06:00
Charles Kerr c832f3c18c
fix: sonarcloud warnings (#2353)
* fix: remove-redundant-cast sonarcloud warning

* fix: make type a pointer-to-const sonarcloud warning

* fix: use-init-statement sonarcloud warning

* fix: use-init-statement sonarcloud warning

* fix: extract-assignment-from-expression sonarcloud warning

* fix: remove-redundant-cast sonarcloud warning

* fix: extract-nested-block-into-method sonarcloud warning
2021-12-28 01:14:52 -06:00
Charles Kerr 6149870540
refactor: remove tr_file.priv (#2349) 2021-12-26 16:04:20 -06:00
Charles Kerr f3228e9670
refactor: further decouple tr_torrent and tr_info (#2336) 2021-12-24 15:12:33 -06:00
Charles Kerr deee2b043e
refactor: take string_view in tr_loadFile(), tr_saveFile() (#2335) 2021-12-24 13:37:34 -06:00
Charles Kerr dd1379b0b6
refactor: add tr_interned_string (#2332) 2021-12-23 11:16:05 -06:00
Charles Kerr b9406dfebb
refactor: even more torrent housekeeping (#2323) 2021-12-16 22:51:53 -06:00
Charles Kerr b93f3f0463
refactor: more tr_torrent housekeeping (#2320) 2021-12-16 03:43:51 -06:00
Charles Kerr 4ea2429217
refactor: tr_torrent housekeeping (#2319) 2021-12-16 02:49:04 -06:00
Charles Kerr 42b1362760
refactor: tidy libtransmission includes (#2316) 2021-12-15 15:25:42 -06:00
Charles Kerr 0f92232c65
fix: memleak regressions (#2293)
* fixup! refactor: add tr_saveFile() (#2267)

fix: memleak regression

* fixup! fixup! refactor: make parts of tr file private (#2241) (#2281)

fix: memory leak regression

* fixup! refactor: use C++ inheritance for tr_peer, tr_peerMsgs, and tr_webseed (#1877)

fix: memory leak regression
2021-12-09 18:49:30 -06:00
Charles Kerr 0a85c3aaa4
fixup! refactor: make parts of tr file private (#2241) (#2281)
fix: crash regression in GTK client details dialog
2021-12-07 19:03:32 -06:00
Charles Kerr 5096bbae9b
refactor: add tr_torrent::file() (#2274)
* refactor: add tr_torrent::fileCount()
2021-12-06 22:18:17 -06:00
Charles Kerr 867a131e1d
refactor: add tr_torrent::fileCount() (#2273)
Provide an accessor to get a torrent's file count.

This is an incremental step towards making tr_torrent's impl private.
2021-12-06 15:26:04 -06:00
Charles Kerr e5e11e3c83
fixup! fix: sonarcloud warnings (#2260) (#2263)
the scope of the buf variable was narrowed too far
2021-12-03 17:20:39 -06:00
Charles Kerr 2977636d58
fix: sonarcloud warnings (#2260)
* fix: add-explicit-keyword-to-constructor warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuB-2farvsyMPiZl&open=AX1tyuB-2farvsyMPiZl

* fix: use a structured binding declaration

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuHH2farvsyMPiZm&open=AX1tyuHH2farvsyMPiZm

* Fix implicit-conversion-loses-precision warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuH22farvsyMPiZn&open=AX1tyuH22farvsyMPiZn

* fix use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuO42farvsyMPiZw&open=AX1tyuO42farvsyMPiZw

* fix implicit-conversion-loses-precision warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuO42farvsyMPiZs&open=AX1tyuO42farvsyMPiZs

* fix: implicit-conversion-loses-precision warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1tyuO42farvsyMPiZt&open=AX1tyuO42farvsyMPiZt

* fix handle-this-exceeption-or-do-not-catch-it warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1y7t12cIz3krp3mVpV&open=AX1y7t12cIz3krp3mVpV

* fix make-this-variable-a-reference-to-const warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1y7t12cIz3krp3mVpW&open=AX1y7t12cIz3krp3mVpW

* fix replace-redundant-type-with-auto warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1y7t12cIz3krp3mVpY&open=AX1y7t12cIz3krp3mVpY

* Fix use-try_emplace-instead-of-emplace warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0WPk3QwxvzFbF6whWN&open=AX0WPk3QwxvzFbF6whWN

* Fix: make-this-a-pointer-to-const warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPUXjI_aUyxGBxB4&open=AX0bZPUXjI_aUyxGBxB4

* Fix use-std::make_unique warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0WPk0twxvzFbF6whWC&open=AX0WPk0twxvzFbF6whWC

* Fix: replace-push_back-with-emplace_back warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0BraL_0QLXO0pQ_Bfv&open=AX0BraL_0QLXO0pQ_Bfv

* Fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPXajI_aUyxGBxB8&open=AX0bZPXajI_aUyxGBxB8

* Fix: replace-redundant-type-with-auto warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPXajI_aUyxGBxB9&open=AX0bZPXajI_aUyxGBxB9

* Fix: replace-emplace-with-try_emplace warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPXajI_aUyxGBxB_&open=AX0bZPXajI_aUyxGBxB_

* Fix: extract-assignment-from-operation warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0bZPXajI_aUyxGBxCA&open=AX0bZPXajI_aUyxGBxCA

* Fix use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX1op6_hUBCnp-Grmra8&open=AX1op6_hUBCnp-Grmra8

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0L8qgMUnpKTxYiu5CN&open=AX0L8qgMUnpKTxYiu5CN

* Revert "Fix use-std::make_unique warning"

This reverts commit 463a742f34.

* fix: make-parameter-a-pointer-to-const warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX06St241usi2gyYkPTZ&open=AX06St241usi2gyYkPTZ

* fix: make-parameter-a-pointer-to-const warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX06St241usi2gyYkPTa&open=AX06St241usi2gyYkPTa

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX01Itn2f_SST5i7BN1o&open=AX01Itn2f_SST5i7BN1o

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AXziv55-MuQoG-Y-NgLX&open=AXziv55-MuQoG-Y-NgLX

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AX0_a_JGNJn7rAzml_68&open=AX0_a_JGNJn7rAzml_68

* fix: replace-redundant-type-with-auto warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AXzyMRYbK9dvryvWm8XA&open=AXzyMRYbK9dvryvWm8XA

* fix: use-init-statement warning

Xref: https://sonarcloud.io/project/issues?id=transmission_transmission&issues=AXziv52fMuQoG-Y-NgLW&open=AXziv52fMuQoG-Y-NgLW
2021-12-01 17:11:57 -06:00
Charles Kerr 35fe175f2a
refactor: add file-piece-map (#2246)
* refactor: add file-piece-map

* refactor: use tr_file_priorities

* refactor: use tr_files_wanted
2021-11-28 19:12:54 -06:00
Charles Kerr ef154e48ae fixup! refactor: tr_completion (#2220)
fix inverted logic regression
2021-11-28 15:55:29 -06:00
Charles Kerr 34881f6295
refactor: make parts of tr file private (#2241)
* refactor: make parts of tr_file private
2021-11-27 21:17:47 -06:00
Charles Kerr de169c7ec3
refactor: tr_completion (#2220)
* refactor: refactor tr_completion + add test coverage for it
2021-11-25 12:26:51 -06:00
Charles Kerr 843e486d2a
refactor: tr_block_info class (#2210)
* refactor: add tr_block_info with tests
2021-11-24 08:48:52 -06:00
Charles Kerr f7b729a350
refactor: add tr_buildTorrentFilename() (#2196)
a simpler API for building .torrent and .resume filenames
2021-11-19 18:36:25 -06:00
Charles Kerr a79a868257
refactor: make tr_variantFromBuf() public (#2187)
* refactor: add tr_variantFromBuf() and support inplace json/benc parsing
2021-11-17 23:37:35 -06:00
Charles Kerr 6571be2b95
feat: add tr_strvPath() (#2134)
* feat: add tr_strvJoin

* feat: add tr_strvPath
2021-11-12 18:10:04 -06:00