Commit Graph

16504 Commits

Author SHA1 Message Date
Yat Ho
dbd4ea5be8 fix(daemon): missing break statement in switch (#7991) 2025-12-23 13:13:32 -06:00
Yat Ho
8241fdab5f fix: handle unaligned torrents in wishlist (#7944)
* fix: handle unaligned torrent pieces and blocks in wishlist

* test: unaligned tests
2025-12-22 23:31:56 -06:00
Yat Ho
dcd516b673 feat: update daemon args for preferred_transports (#7988)
* feat: add `--preferred-transports` to daemon

* chore: deprecate `--(no-)utp` in daemon

* fix: `--(no-)utp` args in daemon
2025-12-22 23:11:41 -06:00
Charles Kerr
257b870604 fix: work around a dumb rapidjson bug (#7985) 2025-12-22 23:10:53 -06:00
Charles Kerr
71ab8cb09f refactor: remove redundant calls to tr_quark_convert() (#7987) 2025-12-22 23:05:55 -06:00
Yat Ho
f2600cf058 chore(remote): deprecate --(no-)utp (#7990) 2025-12-22 23:05:16 -06:00
Charles Kerr
d5314e2c44 refactor: add libtransmission-app (#7978)
* refactor: add libtransmission-app

* refactor: add libtransmission-app/display-modes.h

* refactor: use app::SortMode, app:ShowMode in Qt client

* feat: add to_variant(), to_value() in serializer

* refactor: use app::SortMode in GTK client

* refactor: use app::ShowMode in GTK client

* refactor: make naming consistent with libtransmission-app
2025-12-22 20:05:57 -06:00
Yat Ho
888f90ca1e fix: race condition in tr_torrentStat() (#7948)
* fix: acquire session lock in `tr_torrent::stats()`

* refactor(mac): lock once for the whole updateUI operation
2025-12-22 15:29:15 -06:00
Charles Kerr
62c362eacb fix: clang-tidy warnings in Qt client (#7981)
* fix: readability-identifier-naming

* fix: misc-unused-using-decls

* fix: google-readability-braces-around-statements,hicpp-braces-around-statements,readability-braces-around-statements

* fix: cert-err58-cpp

* fix: bugprone-unchecked-optional-access

* Revert "fix: cert-err58-cpp"

This reverts commit 6e6d97228f.

* fix: better to keep QStringLiteral; disable spurious cert-err58-cpp warning
2025-12-22 09:34:04 -06:00
Yat Ho
1afbe8b675 feat: sync the values of preferred_transports and *_enabled (#7980)
* feat: sync the values of `preferred_transports` and `*_enabled`

* refactor: avoid using `tr_session::allowsTCP()`

* code review: implement fixup methods in source file
2025-12-22 09:15:53 -06:00
Yat Ho
91d9f1f776 feat: generic support for optional fields in serializer (#7979) 2025-12-22 07:58:09 -06:00
Charles Kerr
8f445496c2 refactor: use unmanaged_string for periodic torrent_get fields (#7977)
* refactor: remove Session::addKeyName()

refactor: remove Session::removeKeyName()

these should have been removed a long time ago

* fix: better logging on error in Converters

* refactor: add Qt-app-specific variant converters

* refactor: use tr_variant::unmanaged_string(tr_quark) when in torrent_get table mode
2025-12-21 20:49:41 -06:00
Charles Kerr
0607ea472f perf: use unmanaged strings when populating initial prefs (#7976) 2025-12-21 19:35:14 -06:00
Charles Kerr
433203f82f perf: unmanaged strings in rpcimpl (#7975)
* perf: in rpcimpl, use tr_variant::unmanaged_string() for unit strings

* perf: in rpcimpl, use tr_variant::unmanaged_string() encryption mode

* perf: in rpcimpl, use tr_variant::unmanaged_string() for TrRpcVersionSemver
2025-12-21 11:17:53 -06:00
Charles Kerr
e9c847d965 perf: api_compat::convert() operates inplace rather than creating a new variant (#7973)
* perf: api_compat::convert() operates inplace rather than creating a new variant

* refactor: update bandwidth groups calls
2025-12-21 06:22:05 -06:00
Charles Kerr
4599a7312e refactor: libtransmission::serializer redesign (#7954)
* refactor: libtransmission::serializer redesign

This is a followup to bf48eadaeb with several goals.

- `Converters` now has container-like concepts to make it Just Work
  when a user tries to convert containers of T, e.g. std::vector<T>,
  std::set<T>, QStringList, small:vector<T>, etc.

- `Fields` are now stored in a std::tuple instead of a std::array.
  This has two important benefits:
  1. `Fields` are smaller and can be made constexpr / consteval
  2. We no longer need to use type erasure. The void pointer casts
  and typeinfo lookups are gone and the new code is typesafe.

- naming cleanup:

  - renamed the namespace to `libtransmission::serializer`.
  - renamed the file to `serializer.h`
  - renamed the tr_variant<->T converter registry class to `Converters`.

- removed use of the CRTP. You can now serialize any struct
  without having to subclass `Serializable`.

I think I am done refactoring this for awhile.

* fix: naming is hard

docs: better code comments

* fix: clang-tidy readability-identifier-naming

* Update tests/libtransmission/serializer-tests.cc

Co-authored-by: Yat Ho <lagoho7@gmail.com>

* refactor: remove tr_variant<->int converter

* improve tests

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2025-12-21 06:04:18 -06:00
Charles Kerr
ed827dd1a1 feat: Qt client now formats RPC requests in the RPC server's preferred style (#7963)
* feat: Qt client now formats RPC requests in the RPC server's preferred style

* add macro to build TrRpcVersionSemver

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2025-12-20 11:05:35 -06:00
Yat Ho
615bb4f5e7 refactor: use apicompat for bandwidth-groups.json (#7972) 2025-12-20 11:02:55 -06:00
Charles Kerr
3fc8003c02 refactor: remove tr_variant::StringHolder (#7953)
* perf: remove tr_variant::StringHolder

* fix: disallow get_if<std::string>() and get_if<std::string_view>()

* refactor: remove `tr_variant::VisitAdapter` (#7960)

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2025-12-19 22:24:39 -06:00
Charles Kerr
8a8acfccb6 refactor: add new transmission::app namespace (#7964)
Move `FavIconCache` into a new `transmission::app` namespace.

I intend to add a couple more pieces into libtransmission to avoid
code duplication between the Qt and GTK apps.

We should consider making another module for these pieces if they start
to pile up; but for now, let's cordon them into their own namespace.
2025-12-19 13:58:40 -06:00
Charles Kerr
057fe90b3c fix: copypaste error (#7962)
Xref: https://github.com/transmission/transmission/pull/7892
2025-12-19 12:58:13 -06:00
Yat Ho
15495640d3 refactor: re-use recalculate_wanted_pieces logic in wishlist constructor (#7946)
* refactor: re-use `recalculate_wanted_pieces` logic in wishlist constructor

* test: does not request pieces that the client already has
2025-12-19 12:44:57 -06:00
Yat Ho
f61b0213a9 feat: add X-Transmission-Rpc-Version (#7958) 2025-12-19 10:03:37 -06:00
Yat Ho
c4587503f6 test: variant constructor and assignment operator (#7957)
* test: variant constructor

* test: variant assignment operator
2025-12-19 08:05:05 -06:00
Charles Kerr
804fb20a80 refactor: more JSON-RPC migration in transmission-qt (#7959)
* refactor: use api_compat::convert_incoming_data() and convert_outgoing_data() in RpcClient

* refactor: use convert_outgoing_data() when saving settings.json in Prefs::~Prefs

* refactor: remove all kebab, camel keys from qt client

* refactor: rename RpcResponse.result to RpcResponse.errmsg

* refactor: parse jsonrpc responses

* refactor: build RPC requests in JSON-RPC 2.0

* fix: Qt5 build error
2025-12-19 07:51:52 -06:00
Charles Kerr
1a18462691 refactor: make tr_sessionInit() config_dir arg a string_view (#7939) 2025-12-18 23:06:23 -06:00
Yat Ho
99af641738 docs: update settings.json docs for api-compat (#7955) 2025-12-18 20:06:27 -06:00
Yat Ho
2405c8a151 fix: add client_has_piece check to recalculate_wanted_pieces (#7945) 2025-12-18 14:05:23 -06:00
Charles Kerr
0d036de3e5 fix: support sort mode, show mode in api_compat (#7952)
* refactor: add api-compat for sort-mode

* refactor: add api-compat for show-mode

* test: update tests

* chore: make clang-tidy happy
2025-12-18 14:02:16 -06:00
Yat Ho
c197812b45 refactor: use api-compat for settings.json (#7950) 2025-12-18 10:29:43 -06:00
Charles Kerr
e35527cb4a refactor: minor cleanup in RpcClient.cc (#7951)
* refactor: RpcClient::sendNetworkRequest() takes a QByteArray body arg

* refactor: RpcClient::sendLocalRequest() takes a tr_variant const& req arg

* refactor: move RpcClient::getNextTag() into an anonymous namespace

* refactor: merge RpcClient::exec() and RpcClient::sendRequest()

* refactor: remove unnecessary heap allocation in RpcClient::networkRequestFinished()
2025-12-18 10:29:08 -06:00
Charles Kerr
833e37dab5 build: bump Qt minimum to 5.15 (#7943)
* deps: bump QT_MINIMUM from 5.6 to 5.15

* chore: remove now-obsolete qt >= 5.8 checks

* chore: remove now-obsolete qt >= 5.14 checks
2025-12-18 07:39:25 -06:00
Charles Kerr
6fcd2d2297 fix: invalidateFilter() Qt deprecation warning (#7940) 2025-12-17 02:04:46 -06:00
Charles Kerr
f8970a9183 refactor: use the new jsonrpc API for RPC calls in tr-gtk (#7938)
* feat: copy TR_RPC_VERBOSE env var feature from tr-qt
2025-12-16 15:20:51 -06:00
Cœur
c56723ef1f chore: compatibility with clang-format 20 to 21 (#7499) 2025-12-15 23:55:32 -06:00
Charles Kerr
fcd1e2ff8a refactor: simplify tr_sessionLoadSettings() args (#7935)
* refactor: remove unused appname arg from tr_sessionLoadSettings()

* refactor: swap order of arguments to tr_sessionLoadSettings()
  so way the optional arg can go at the end
2025-12-15 13:44:38 -06:00
Charles Kerr
109bc70511 feat: use api_compat for torrent .resume files (#7932)
* test: add benc2cpp.py, a benc beautifier for hardcoded cpp test cases

* test: add .resume file unit test

* refactor: use api_compat::convert_incoming_data() and convert_outgoing_data() on .resume files

* chore: mark TR_KEY_peers2_6_kebab as APICOMPAT

* chore: mark TR_KEY_speed_Bps_kebab as APICOMPAT

* chore: mark TR_KEY_use_speed_limit_kebab as APICOMPAT

* chore: mark as APICOMPAT: TR_KEY_use_global_speed_limit_kebab

* chore: mark as APICOMPAT: TR_KEY_ratio_mode_kebab

* chore: mark as APICOMPAT: TR_KEY_idle_limit_kebab

* chore: mark as APICOMPAT: TR_KEY_idle_mode_kebab

* chore: mark as APICOMPAT: TR_KEY_max_peers_kebab

* chore: mark as APICOMPAT: TR_KEY_added_date_kebab

* chore: mark as APICOMPAT: TR_KEY_seeding_time_seconds_kebab

* chore: mark as APICOMPAT: TR_KEY_downloading_time_seconds_kebab

* chore: mark as APICOMPAT: TR_KEY_bandwidth_priority

* chore: mark as APICOMPAT: TR_KEY_done_date_kebab

* chore: mark as APICOMPAT: TR_KEY_activity_date_kebab

* chore: remove remaining _kebab cases from resume.cc

* chore: clang-format
2025-12-15 09:43:40 -06:00
Yat Ho
725655653a fix: FTBFS with rapidjson 1.1.0 release on GCC < 12 (#7933)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85790
2025-12-15 09:39:46 -06:00
Chase Knowlden
3b4dab66eb fix: build with Visual Studio 2026 (#7924) 2025-12-14 23:26:29 -06:00
Charles Kerr
d7f022599c feat: use api_compat for stats.json (#7918)
* feat: use api_compat for stats.json

* chore: flag old stats.json keys as api_compat-only
2025-12-14 19:44:20 -06:00
Mike Gelfand
887473cade Fix missing Qt client icons on Windows (#7931)
* Enable FreeType and Harfbuzz for Windows release builds

This fixes icon font glyphs rendering in Qt client.

* Bump Qt to 6.10.1

* Use pixel sizes for icon font glyphs rendering on Windows

The glyphs otherwise turn out of a smaller, non-standard size which
makes them less crisp.
2025-12-14 20:39:02 +00:00
Charles Kerr
9a792046f3 feat: add libtransmission::api_compat::convert() (#7917)
Add a module to convert between tr4 and tr5 RPC / settings / config file payloads.

This will be used as a compatibility layer between Transmission 5's naming scheme
and Transmission <= 4.

Co-authored-by: Yat Ho <lagoho7@gmail.com>
Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
2025-12-14 10:56:07 -06:00
Charles Kerr
98fdf2dc0b perf: use small::vector<> when sorting map keys (#7928)
I collected stats for a full day & found N=32 to be enough for 99% of cases
2025-12-13 14:45:43 -06:00
Charles Kerr
0fcda4e977 feat: add tr_variant::visit() (#7923)
* refactor: make tr_variant work with std::visit()

* refactor: use tr_variant::visit() in tr_variant_serde

* refactor: use tr_variant::visit() in tr_variant::merge()

* refactor: simplify JsonWriter

* fix: clang-tidy misc-use-internal-linkage

* test: simplify VariantTest.visitsNodesDepthFirst()

* test: simplify VariantTest.visitNestedJsonSummarizesStructure()

* feat: add tr_variant::clone()

* test: simplify variant tests

* docs: add code comments for tr_variant::merge() and tr_variant::clone()

* fix: add stack-smashing handling for JSON parsing

* fix: clang-tidy modernize-raw-string-literal

* Use writer.Key() for object key names

* refactor: remove unnecessary FMT_COMPILE() macros

* refactor: fix tr_variant::VisitAdapter to preserve the visitor category

chore: remove unnecessary std::cref() calls when calling tr_variant::visitor()

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2025-12-13 13:47:54 -06:00
Charles Kerr
64268a3a7f feat: remove informed-consent dialogs (#7920) 2025-12-10 16:28:49 -06:00
Yat Ho
2ee411d222 ci: set ENABLE_TESTS to make-tests on alpine (#7914) 2025-12-10 11:48:48 -06:00
Charles Kerr
f73a259a4e docs: add quark citation code comments (#7912) 2025-12-10 08:18:38 -06:00
Yat Ho
a8e20bf358 refactor: track active request timeout per peer per block (#7899) 2025-12-09 22:42:49 -06:00
Charles Kerr
bf48eadaeb refactor: replace Settings class with Serializable (#7877)
* refactor: replace Settings class with Serializable

* Fields can now be declared as const static,
  so we only have to build this list once per class
  instead of once per iteration.

* Add typesafe single-property getters & setters.

* Split the converter registry into a generic standalone class.

* refactor: make Serializable::Field::getter private

refactor: make Serializable::Field::const_getter private

* docs: tweak code comments

* refactor: make Serializable::Field::Getter private

refactor: make Serializable::Field::ConstGetter private

refactor: make Serializable::Field::MemberStorage private

* chore: fix readability-identifier-naming clang-tidy warnings

* Update libtransmission/serializable.h

Co-authored-by: Yat Ho <lagoho7@gmail.com>

* Update libtransmission/serializable.h

Co-authored-by: Yat Ho <lagoho7@gmail.com>

* Update libtransmission/serializable.h

Co-authored-by: Yat Ho <lagoho7@gmail.com>

* fixup! Update libtransmission/serializable.h

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
2025-12-09 22:09:49 -06:00
Charles Kerr
e671c0346c feat: add tr_variant::Map methods (#7910)
* feat: add tr_variant::Map::contains()

* feat: add tr_variant::Map::replace_key()

* fixup! feat: add tr_variant::Map::replace_key()

fix readability-braces-around-statements

* fixup! feat: add tr_variant::Map::contains()

readability-container-contains
2025-12-09 21:16:59 -06:00