Commit Graph

16688 Commits

Author SHA1 Message Date
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
Charles Kerr
9f911d4d52 refactor: intern recently-active (#7909)
* refactor: intern recently-active

* fixup! refactor: intern recently-active

fix a couple of literals missed in rpcimpl.cc
2025-12-09 21:15:07 -06:00
Charles Kerr
64231c1076 refactor: extract-method is_valid_id() in rpcimpl (#7907) 2025-12-09 18:18:46 -06:00
Yat Ho
ca325e5c42 fix: add conversion from kebab-case to sleep_per_seconds_during_verify (#7870) 2025-12-09 18:12:51 -06:00
github-actions[bot]
4bf5c32a1f chore: update generated transmission-web files (#7863)
Co-authored-by: ckerr <70381+ckerr@users.noreply.github.com>
2025-12-09 18:10:04 -06:00
Charles Kerr
a630787340 test: add rpc tests for legacy & jsonrpc free_space requests, responses (#7905) 2025-12-09 16:19:01 -06:00
Charles Kerr
fece4137c7 refactor: add tr_variant::unmanaged_string(tr_quark) (#7906)
* feat: add tr_variant::unmanaged_string(tr_quark)

* refactor: use tr_variant::unmanaged_string(tr_quark)
2025-12-09 14:58:15 -06:00
Yat Ho
20161fa044 fix: only shrink wishlist block span if previous piece is wanted (#7900) 2025-12-09 14:01:00 -06:00
Charles Kerr
0979bbcc3f refactor: intern RPC method names (#7892)
* refactor: add quarks for the RPC method names

* update tr_quark_convert() to handle RPC method names

* refactor: use interned keys for RPC method names

* test: add torrentGetLegacy test

* refactor: use interned keys for RPC method names in tr-qt

* refactor: use interned keys for RPC method names in tr-remote

* refactor: use interned keys for RPC method names in tests

* refactor: use interned keys for RPC method names in tr-gtk

* chore: fix readability-identifier-naming regression
2025-12-09 11:48:09 -06:00
Yat Ho
095bad6568 fix: check if piece is wanted upon receiving block (#7866)
* fix: check if piece is wanted upon receiving block

* test: block_last_loc
2025-12-08 15:43:56 -06:00
Charles Kerr
33d6804a76 refactor: remove unused quarks (#7883)
* chore: remove two unused quarks

looks like these were never used?

* chore: remove unused quark TR_KEY_have

unused since May 2024 3677e7a5

* chore: remove unused quark TR_KEY_date

unused since Oct 2021 9200d972

* fix: remove unused codepath
2025-12-07 21:08:07 -06:00
Yat Ho
e034799f6f perf: use iterator range insert in Wishlist::next (#7890) 2025-12-07 11:15:14 -06:00
Yat Ho
8dc5080dc7 fix: FTBFS in C++20 (#7880) 2025-12-06 01:31:55 -06:00
Charles Kerr
4bbc2e9c42 ci: use clang for alpine-musl build (#7879) 2025-12-05 18:26:35 -06:00
Charles Kerr
2cddbce459 chore: update package-lock.json (#7878)
resolve js-yaml CVE-2025-64718

This CVE does not affect Transmission users. We only use this package for running eslint checcks in CI.
2025-12-05 16:44:23 -06:00
Charles Kerr
c92b42de9c chore: bump to 4.1.0-beta.4 (#7869)
* docs: add release notes for 4.1.0-beta.4

* chore: bump to Transmission 4.1.0-beta.3
4.1.0-beta.4
2025-12-03 17:04:08 -06:00
Yat Ho
9dd9aab902 build: bump clang tools to 20 (#7573)
* build: bump to clang-format-20

* build: bump to clang-tidy-20

* chore: revert edc59ba5d8
2025-12-01 23:18:02 -06:00