2135 Commits

Author SHA1 Message Date
Yat Ho
5f663bb6a4 fix(gtk): crash when toggling alt speed limit (#8703) 2026-03-19 13:02:44 -05:00
Yat Ho
eac99ff1a0 fix: readability-container-contains (#8656)
* fix(core): `readability-container-contains`

* fix(test): `readability-container-contains`

* build(gtk): enable `readability-container-contains`

* fix(qt): `readability-container-contains`
2026-03-05 10:00:29 -06:00
Charles Kerr
5e305a2d26 refactor: simplify session callbacks (#8646)
* refactor: add a Torrent.id property

* feat: add Controller.torrentForId

* refactor: make tr_session_idle_limit_hit_func a std::function

* refactor: make tr_session_metadata_func a std::function

* refactor: make tr_session_ratio_limit_hit_func a std::function

* refactor: make tr_torrent_completeness_func a std::function

* refactor: make tr_altSpeedFunc a std::function

* refactor: make tr_sessionSetQueueStartCallback callback a std::function

* refactor: make tr_rpc_callback_status callback a std::function

* refactor: remove user_data arg from tr_torrent_rename_done_func

* refactor: harden `tr_torrentFindFromId()` by making it safe to pass in a nullptr session
2026-03-03 16:02:54 -06:00
Yat Ho
b561960d51 fix: enable modernize-use-ranges (#8626)
* fix(core): enable `modernize-use-ranges`

* fix(test): enable `modernize-use-ranges`

* fix(qt): enable `modernize-use-ranges`

* fix(gtk): enable `modernize-use-ranges`
2026-02-26 08:22:29 -06:00
Yat Ho
6a6b0dbcc5 ci: run clang-tidy-libtransmission for app/test-only changes (#8612)
* ci: run `clang-tidy-libtransmission` for app/test-only changes

* fix: fix another new clang-tidy regression

---------

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-02-24 23:49:55 -06:00
Charles Kerr
8c9eab9a96 fixup! fix: show translated logging level strings (#8609) (#8615)
fix new clang-tidy warning
2026-02-24 20:07:28 -06:00
Charles Kerr
32d0daafd9 fix: show translated logging level strings (#8609) 2026-02-24 07:47:28 -06:00
Yat Ho
5b52ba92c0 fix: enable modernize-use-designated-initializers (#8592)
* fix(qt): enable `modernize-use-designated-initializers`

* fix(gtk): enable `modernize-use-designated-initializers`
2026-02-21 10:45:14 -06:00
Charles Kerr
5856619fbc fix: FTBFS with glibmm 2.68 (#8565) 2026-02-18 18:46:54 -06:00
Charles Kerr
c3b5fab4f4 fix: FTBFS with glibmm-2.68 (#8552)
13:45:53 /home/fedora/jenkins/workspace/trunk-linux/transmission-4.1.0-beta.5+r6c92d06854/gtk/DetailsDialog.cc:974:52:   required from here
13:45:53   974 |         bool const is_uniform = std::ranges::all_of(stats, [&baseline](auto const& st) { return baseline == st.error_string; });
13:45:53       |                                 ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13:45:53 /usr/include/glibmm-2.68/glibmm/ustring.h:1501:22: error: no matching function for call to ‘Glib::ustring::compare(const std::__cxx11::basic_string<char>&) const’
13:45:53  1501 |   return (lhs.compare(rhs) == 0);
13:45:53       |           ~~~~~~~~~~~^~~~~
2026-02-17 17:58:21 -06:00
Yat Ho
fc309238ce ci(gtk): run clang-tidy (#8251)
* ci: infra for parallel clang-tidy runs

* ci(gtk): run clang-tidy

* chore(gtk): silence warnings

* code review: use constexpr auto

* code review: use constants over magic numbers in Utils.cc

* code review: use `std::ignore` to ignore return value

* code review: add back visibility labels that indicated sections

* fix: wrap each command argument in single quotes
2026-02-17 17:53:01 -06:00
Charles Kerr
e29acee865 fix: cannot add magnet links from the command line (#8415) (#8476) 2026-02-15 01:19:42 -06:00
Yat Ho
e3853d9750 build: remove ENABLE_DEPRECATED (#8461) 2026-02-12 09:56:50 -06:00
Yat Ho
cd920a7bec ci(app): run clang-tidy (#8442)
* fix(app): clang-tidy warnings

* build(app): convert checks to list

* build(app): fix clang-tidy `HeaderFilterRegex`

* ci(app): run clang-tidy

* fix: ftbfs

* wtf
2026-02-12 00:23:00 -06:00
Charles Kerr
21874392a9 refactor: string-utils, file-utils, env (#8417)
* refactor: add libtransmission/string-utils

* refactor: add libtransmission/file-utils

* refactor: add libtransmission/env

* build: update Xcode
2026-02-11 11:21:45 -06:00
Yat Ho
a89f4bd5bd perf(gtk): move from request parameters instead of copying (#8389) 2026-02-10 10:56:59 -06:00
Charles Kerr
f63db2a059 fix: support Glib::ustring in Converters (#8418)
fixes regression introduced in 64a53a8
2026-02-10 08:51:56 -06:00
Charles Kerr
a8072d82f0 fix use different icon filenames per-client (#8281)
this prevents multiple packages from conflicting over a shared icon filename
2026-02-05 22:57:38 -06:00
Charles Kerr
80a379f713 fix: mark strings for translation (#8351)
* fix: encryption mode not saved between sessions in GTK client

* fix: some strings were not correctly marked for translation
2026-02-05 16:12:44 -06:00
Yat Ho
2e65935bbc build: wrap fmt::fmt-header-only with transmission::fmt-header-only (#8370) 2026-02-05 07:50:11 -06:00
Charles Kerr
ca873c4ba2 fix: encryption mode not saved between sessions in GTK client (#8348) 2026-02-03 22:07:46 -06:00
Charles Kerr
bd4f81f87c fix: race condition when removing torrents in GTK client (#8341)
* fix: race condition crash when removing torrents in GTK client

* refactor: remove unused on_remove_done arg from tr_torrentRemove()
2026-02-03 18:10:54 -06:00
Charles Kerr
90402fd97b refactor: move StatsMode to tr::app (#8330)
* refactor: add StatsMode to libtransmission-app

* test: add display-mode unit tests

* feat: add apicompat for StatsMode

* refactor: use StatsMode in Qt client

* refactor: add template method for gtr_set_pref()

* refactor: use StatsMode in GTK client

* ci: use the all-tests alias instead of hardcoding tests

* ci: copy runtime DLLS into test output directory for Windows test binaries
2026-02-03 09:52:49 -06:00
Charles Kerr
2649e7acdd refactor: use std::filesystem for more file utils (#8296)
* fix: warning: declaration shadows a variable in the global namespace [clang-diagnostic-shadow]

* fix: warning: use 'contains' to check for membership [readability-container-contains]

* fix: warning: variable gl_confdir can be made static or moved into an anonymous namespace to enforce internal linkage [misc-use-internal-linkage]

* warning: function 'TorrentFilter::match_mode' has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]

* refactor: use std::filesystem for tr_sys_path_is_same()

* refactor: use std::filesystem for tr_sys_path_exists()

* refactor: use std::filesystem for tr_sys_path_is_relative()

* refactor: use std::filesystem for tr_sys_path_get_info()

* refactor: use std::filesystem for tr_sys_dir_create()

* refactor: add `maybe_set_error()` helper

* refactor: change behavior to match previous impl

* fix: tr_sys_path_is_same() checks

refactor: address code review feedback

* refactor: address code review feedback

* chore: fix readability-else-after-return clang-tidy warning

* fix: warning: Value stored to 'created' during its initialization is never read [clang-analyzer-deadcode.DeadStores]

fix: warning: parameter 'permissions' is unused [misc-unused-parameters]

* ci: work around a MSVC STL 14.44.35207 clang-tidy false warning

* refactor: simplify return logic of tr_sys_path_is_same()
2026-02-01 15:37:37 -06:00
Charles Kerr
32b3f1ba43 fix: do not use underscore in gio action names (#8294) 2026-01-30 13:05:27 -06:00
Yat Ho
3a8a4d9b86 refactor: wrap std::filesystem::space calls (#8284)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-01-30 11:18:04 -06:00
Charles Kerr
b41ae71574 fix: cannot add magnet links in GTK client (#8278) 2026-01-29 16:46:59 -06:00
Charles Kerr
9723d7b4bd fix: crash on fail to update blocklist on GTK when assertions are enabled (#8274)
regressed in f8970a9 in 4.1.0-beta.5
2026-01-29 11:45:10 -06:00
Yat Ho
19c52a3e61 fix: pass UTF-8 strings into std::filesystem::path (#8269)
* feat: temporary replacement for `std::filesystem::u8path()`

* fix: pass UTF-8 strings into `std::filesystem::path`
2026-01-29 08:43:50 -06:00
Charles Kerr
dd008ae1d0 refactor: C++ify tr_torrentStat() (#8257)
* refactor: callers now own the return value of tr_torrentStat()

fix one potential thread issue by simplifying ownership

* refactor: make tr_stat_errtype an enum class; move into tr_stat

* refactor: order tr_stat fields to reduce padding

* chore: fix branch shear

* fix: int-to-enum-class comparison

* fix: namespace regression

* chore: make clang-tidy happy
2026-01-29 08:07:11 -06:00
Yat Ho
34bf2c5b21 refactor: remove tr_sys_path_get_capacity (#8249)
* refactor: remove `tr_sys_path_get_capacity`

* code review: remove unused definitions
2026-01-28 21:32:24 -06:00
Charles Kerr
554cc56bdf refactor: rename our namespace to tr (#8256)
tr and tr::app are less cluttered than libtransmission:: and transmission::app
2026-01-28 18:11:34 -06:00
Charles Kerr
7559f7ffca refactor: C++ify tr_torrentPeers() (#8253)
* refactor: tr_torrentPeers() now returns a std::vector<tr_peer_stat>

* refactor: make tr_peer_stat.client a std::string_view

* refactor: make tr_peer_stat.flag_str a std::string

* refactor: make tr_peer_stat.addr a std::string

* refactor: rename tr_peer_stat field names to camel_case

* refactor: use Speed type for tr_peer_stat speed fields

* refactor: add default initializers to tr_peer_stat fields

* refactor: order tr_peer_stat fields to reduce padding

* fix: typo in [Torrent peers] getter

* refactor: make tr_peer_stat.user_agent a std::string

* refactor: pass by reference instead of by pointer in DetailsDialog

* fixup! refactor: add default initializers to tr_peer_stat fields
2026-01-28 15:16:12 -06:00
Charles Kerr
4e1b092a17 refactor: use std::remove_cvref_t (#8240) 2026-01-27 20:14:47 -06:00
Charles Kerr
68e9049b17 refactor: tr_torrentRemove() now takes std::function args (#8229) 2026-01-27 14:37:11 -06:00
Charles Kerr
78e733e7bd refactor: fix trivial modernize-use-ranges warnings (#8181) 2026-01-27 12:16:36 -06:00
Yat Ho
2362afd113 refactor: remove tr_isDirection() (#8213) 2026-01-26 10:00:02 -06:00
Charles Kerr
cccef8e2a6 refactor: use fewer raw C strings (#8202)
* refactor: tr_ctorGetDownloadDir() returns a std::optional<std::string>

* refactor: tr_sessionGetConfigDir() now returns a std::string

* refactor: tr_sessionGetDownloadDir() now returns a std::string

* refactor: tr_sessionGetIncompleteDir() now returns a std::string

* refactor: tr_sessionGetRPCWhitelist() now returns a std::string

* refactor: tr_sessionGetRPCPassword() now returns a std::string

* refactor: tr_sessionGetRPCUsername() now returns a std::string

* refactor: tr_sessionGetScript() now returns a std::string

* refactor: tr_blocklistGetURL() now returns a std::string

* refactor: tr_ctorGetSourceFile() now returns a std::optional<std::string>

* refactor: tr_torrentFile() now returns a std::string
2026-01-22 22:36:24 -06:00
Charles Kerr
e7129cfd54 refactor: use fewer raw C strings (#8201)
* refactor: tr_blocklistSetURL() takes a string_view

* refactor: tr_ctorSetMetainfoFromFile() takes a string_view

* refactor: tr_ctorSetMetainfoFromMagnetLink() takes a string_view

* refactor: tr_torrentSetDownloadDir() takes a string_view

* refactor: tr_ctorSetDownloadDir() takes a string_view

* refactor: tr_ctorSetIncompleteDir() takes a string_view

* refactor: tr_torrentSetTrackerList() takes a string_view

* refactor: tr_torrentRenamePath() now takes a std::string_view

* refactor: tr_torrentFindFromMagnetLink() takes a string_view
2026-01-22 16:31:08 -06:00
Charles Kerr
f6e9027da7 refactor: use fewer raw C strings (#8200)
* refactor: tr_sessionSaveSettings() takes a string_view

* refactor: tr_sessionSetDownloadDir() takes a string_view

* refactor: tr_sessionSetIncompleteDir() takes a string_view

* refactor: tr_sessionSetRPCCWhitelist() takes a string_view

* refactor: tr_sessionSetRPCPassword() takes a string_view

* refactor: tr_sessionSetRPCUsername() takes a string_view

* refactor: tr_sessionSetDefaultTrackers() takes a string_view

* refactor: tr_sessionSetScript() takes a string_view
2026-01-22 14:38:20 -06:00
Charles Kerr
46005038e6 refactor: tr_torrentGetCurrentDir() returns a std::string_view (#8173)
* refactor: gtr_open_file() now takes a std::string_view

refactor: gtr_open_file() now calls Glib::filename_to_uri()

refactor: add gtr_open_file() variant that takes basedir and relative path

refactor: gtr_open_uri() now takes a relative_path std::string_view

* refactor: tr_torrentGetCurrentDir() now returns a std::string_view

refactor: tr_torrentGetDownloadDir() now returns a std::string_view
2026-01-21 11:40:16 -06:00
Charles Kerr
62be679769 refactor: remove tr_session* argument from tr_rpc_response_func (#8160) 2026-01-20 19:44:06 -06:00
Yat Ho
cbc5388440 build: bump to C++20 (#7191)
* build: bump to C++20

Co-authored-by: Cœur <coeur@gmx.fr>

* refactor: use designated initializers

* refactor: remove redundant SFINAE

* fix: clang-tidy warnings

* chore: comments about min compiler versions for C++20 features

* build: clang objc++ modules build errors

Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* refactor: add `TR_CONSTEXPR_VEC` and `TR_CONSTEXPR_STR`

* fix: don't use `std::rel_ops`

* chore: housekeeping

* fix: possible fix for macOS linker error

---------

Co-authored-by: Cœur <coeur@gmx.fr>
Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2026-01-20 16:27:34 -06:00
Charles Kerr
4a05c06ce0 perf: add batch variant of tr_torrentStat() (#8100)
* refactor: add [Torrent updateTorrents]

refactor: use updateTorrents in Controller

* refactor: add a batch variant of tr_torrentStat()

* refactor: use batch variant of tr_torrentStat() in GTK details dialog

* refactor: use batch variant of tr_torrentStat() in gtr_confirm_remove()

* refactor: use batch variant of tr_torrentStat() in updateTorrents

* refactor: add Session::find_torrents()

* refactor: remove the raw ptr variant of updateTorrents()

* refactor: remove tr_sessionLock()

* fixup! refactor: add [Torrent updateTorrents]

remove duplicate method declaration

* fix: readability-avoid-const-params-in-decls

* fix: iwyu in transmission.h

* chore: remove an #include that was added in a draft that did not get used

* refactor: use nullptr instead of NULL
2026-01-12 16:23:06 -06:00
github-actions[bot]
5ce17df2e5 chore: update copyright years (#8039)
* chore: update copyright year in COPYING

* chore: update copyright year in user-facing files (1)

* chore: update copyright year in user-facing files (2)

* chore: update copyright year in cmake/transmission.rc.in

---------

Co-authored-by: github-actions <github-actions@github.com>
2025-12-31 21:59:44 -06:00
Charles Kerr
850d2a277f refactor: use snake_case for action names in GTK client (#8008)
* refactor use snake_case for action names in GTK app

* refactor: remove tr_quark_convert() use
2025-12-25 14:01:23 -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
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
1a18462691 refactor: make tr_sessionInit() config_dir arg a string_view (#7939) 2025-12-18 23:06:23 -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