Commit Graph

2122 Commits

Author SHA1 Message Date
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
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
64268a3a7f feat: remove informed-consent dialogs (#7920) 2025-12-10 16:28:49 -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
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
Yat Ho
05aef3e787 refactor: unify quarks and strings to snake_case (#7108)
* refactor: change `leftUntilDone` to `left_until_done`

* refactor: change `magnetLink` to `magnet_link`

* refactor: change `manualAnnounceTime` to `manual_announce_time`

* refactor: change `maxConnectedPeers` to `max_connected_peers`

* refactor: change `metadataPercentComplete` to `metadata_percent_complete`

* refactor: change `peersConnected` to `peers_connected`

* refactor: change `peersFrom` to `peers_from`

* refactor: change `peersGettingFromUs` to `peers_getting_from_us`

* refactor: change `peersSendingToUs` to `peers_sending_to_us`

* refactor: change `percentComplete` to `percent_complete`

* refactor: change `percentDone` to `percent_done`

* refactor: change `pieceCount` to `piece_count`

* refactor: use quark when possible

* refactor: change `pieceSize` to `piece_size`

* refactor: change `primary-mime-type` to `primary_mime_type`

* refactor: change `rateDownload` to `rate_download`

* refactor: change `rateUpload` to `rate_upload`

* refactor: change `recheckProgress` to `recheck_progress`

* refactor: change `secondsDownloading` to `seconds_downloading`

* refactor: change `secondsSeeding` to `seconds_seeding`

* refactor: change `sizeWhenDone` to `size_when_done`

* refactor: change `startDate` to `start_date`

* refactor: change `trackerStats` to `tracker_stats`

* refactor: change `totalSize` to `total_size`

* refactor: change `torrentFile` to `torrent_file`

* refactor: change `uploadedEver` to `uploaded_ever`

* refactor: change `uploadRatio` to `upload_ratio`

* refactor: change `webseedsSendingToUs` to `webseeds_sending_to_us`

* refactor: change `bytesCompleted` to `bytes_completed`

* refactor: change `clientName` to `client_name`

* refactor: change `clientIsChoked` to `client_is_choked`

* refactor: change `clientIsInterested` to `client_is_interested`

* refactor: change `flagStr` to `flag_str`

* refactor: change `isDownloadingFrom` to `is_downloading_from`

* refactor: change `isEncrypted` to `is_encrypted`

* refactor: change `isIncoming` to `is_incoming`

* refactor: change `isUploadingTo` to `is_uploading_to`

* refactor: change `isUTP` to `is_utp`

* refactor: change `peerIsChoked` to `peer_is_choked`

* refactor: change `peerIsInterested` to `peer_is_interested`

* refactor: change `rateToClient` to `rate_to_client`

* refactor: change `rateToPeer` to `rate_to_peer`

* refactor: change `fromCache` to `from_cache`

* refactor: change `fromDht` to `from_dht`

* refactor: change `fromIncoming` to `from_incoming`

* refactor: change `fromLpd` to `from_lpd`

* refactor: change `fromLtep` to `from_ltep`

* refactor: change `fromPex` to `from_pex`

* refactor: change `fromTracker` to `from_tracker`

* refactor: change `announceState` to `announce_state`

* refactor: change `downloadCount` to `download_count`

* refactor: change `hasAnnounced` to `has_announced`

* refactor: change `hasScraped` to `has_scraped`

* refactor: change `isBackup` to `is_backup`

* refactor: change `lastAnnouncePeerCount` to `last_announce_peer_count`

* refactor: change `lastAnnounceResult` to `last_announce_result`

* refactor: change `lastAnnounceStartTime` to `last_announce_start_time`

* refactor: change `lastAnnounceSucceeded` to `last_announce_succeeded`

* refactor: change `lastAnnounceTime` to `last_announce_time`

* refactor: change `lastAnnounceTimedOut` to `last_announce_timed_out`

* refactor: change `lastScrapeResult` to `last_scrape_result`

* refactor: change `lastScrapeStartTime` to `last_scrape_start_time`

* refactor: change `lastScrapeSucceeded` to `last_scrape_succeeded`

* refactor: change `lastScrapeTime` to `last_scrape_time`

* refactor: change `lastScrapeTimedOut` to `last_scrape_timed_out`

* refactor: change `leecherCount` to `leecher_count`

* refactor: change `nextAnnounceTime` to `next_announce_time`

* refactor: change `nextScrapeTime` to `next_scrape_time`

* refactor: change `scrapeState` to `scrape_state`

* refactor: change `seederCount` to `seeder_count`

* refactor: change `torrent-added` to `torrent_added`

* refactor: change `torrent-duplicate` to `torrent_duplicate`

* refactor: change `torrent-remove` to `torrent_remove`

* refactor: change `delete-local-data` to `delete_local_data`

* refactor: change `torrent-rename-path` to `torrent_rename_path`

* refactor: change `alt-speed-down` to `alt_speed_down`

* refactor: convert `pref_toggle_entries` to quark array

* refactor: change `alt-speed-enabled` to `alt_speed_enabled`

* refactor: change `compact-view` to `compact_view`

* refactor: change `sort-reversed` to `sort_reversed`

* refactor: change `show-filterbar` to `show_filterbar`

* refactor: change `show-statusbar` to `show_statusbar`

* refactor: change `show-toolbar` to `show_toolbar`

* refactor: change `alt-speed-time-begin` to `alt_speed_time_begin`

* refactor: change `alt-speed-time-day` to `alt_speed_time_day`

* refactor: change `alt-speed-time-end` to `alt_speed_time_end`

* refactor: change `alt-speed-up` to `alt_speed_up`

* refactor: change `alt-speed-time-enabled` to `alt_speed_time_enabled`

* refactor: change `blocklist-enabled` to `blocklist_enabled`

* refactor: change `blocklist-size` to `blocklist_size`

* refactor: change `blocklist-url` to `blocklist_url`

* refactor: change `cache-size-mb` to `cache_size_mb`

* refactor: change `config-dir` to `config_dir`

* refactor: change `default-trackers` to `default_trackers`

* refactor: change `dht-enabled` to `dht_enabled`

* refactor: change `download-dir-free-space` to `download_dir_free_space`

* refactor: change `download-queue-enabled` to `download_queue_enabled`

* refactor: change `download-queue-size` to `download_queue_size`

* refactor: change `idle-seeding-limit-enabled` to `idle_seeding_limit_enabled`

* refactor: change `idle-seeding-limit` to `idle_seeding_limit`

* refactor: change `incomplete-dir-enabled` to `incomplete_dir_enabled`

* refactor: change `incomplete-dir` to `incomplete_dir`

* refactor: change `lpd-enabled` to `lpd_enabled`

* refactor: change `peer-limit-global` to `peer_limit_global`

* refactor: change `peer-limit-per-torrent` to `peer_limit_per_torrent`

* refactor: change `peer-port-random-on-start` to `peer_port_random_on_start`

* refactor: change `peer-port` to `peer_port`

* refactor: change `pex-enabled` to `pex_enabled`

* refactor: change `port-forwarding-enabled` to `port_forwarding_enabled`

* refactor: change `queue-stalled-enabled` to `queue_stalled_enabled`

* refactor: change `queue-stalled-minutes` to `queue_stalled_minutes`

* refactor: change `rename-partial-files` to `rename_partial_files`

* refactor: change `rpc-version-minimum` to `rpc_version_minimum`

* refactor: change `rpc-version-semver` to `rpc_version_semver`

* refactor: change `rpc-version` to `rpc_version`

* refactor: change `script-torrent-added-enabled` to `script_torrent_added_enabled`

* refactor: change `script-torrent-added-filename` to `script_torrent_added_filename`

* refactor: change `script-torrent-done-enabled` to `script_torrent_done_enabled`

* refactor: change `script-torrent-done-filename` to `script_torrent_done_filename`

* refactor: change `script-torrent-done-seeding-enabled` to `script_torrent_done_seeding_enabled`

* refactor: change `script-torrent-done-seeding-filename` to `script_torrent_done_seeding_filename`

* refactor: change `seed-queue-enabled` to `seed_queue_enabled`

* refactor: change `seed-queue-size` to `seed_queue_size`

* refactor: change `seedRatioLimited` to `seed_ratio_limited`

* refactor: change `session-id` to `session_id`

* refactor: change `speed-limit-down-enabled` to `speed_limit_down_enabled`

* refactor: change `speed-limit-down` to `speed_limit_down`

* refactor: change `speed-limit-up-enabled` to `speed_limit_up_enabled`

* refactor: change `speed-limit-up` to `speed_limit_up`

* refactor: change `start-added-torrents` to `start_added_torrents`

* refactor: change `trash-original-torrent-files` to `trash_original_torrent_files`

* refactor: change `utp-enabled` to `utp_enabled`

* refactor: change `tcp-enabled` to `tcp_enabled`

* docs: add missing docs for RPC `tcp_enabled`

* refactor: change `speed-units` to `speed_units`

* refactor: change `speed-bytes` to `speed_bytes`

* refactor: change `size-units` to `size_units`

* refactor: change `size-bytes` to `size_bytes`

* refactor: change `memory-units` to `memory_units`

* refactor: change `memory-bytes` to `memory_bytes`

* refactor: change `session-set` to `session_set`

* refactor: change `session-get` to `session_get`

* refactor: change `session-stats` to `session_stats`

* refactor: change `activeTorrentCount` to `active_torrent_count`

* refactor: change `downloadSpeed` to `download_speed`

* refactor: change `pausedTorrentCount` to `paused_torrent_count`

* refactor: change `torrentCount` to `torrent_count`

* refactor: change `uploadSpeed` to `upload_speed`

* refactor: change `cumulative-stats` to `cumulative_stats`

* refactor: change `current-stats` to `current_stats`

* refactor: change `uploadedBytes` and `uploaded-bytes` to `uploaded_bytes`

* refactor: change `downloadedBytes` and `downloaded-bytes` to `downloaded_bytes`

* refactor: change `filesAdded` and `files-added` to `files_added`

* refactor: change `sessionCount` and `session-count` to `session_count`

* refactor: change `secondsActive` and `seconds-active` to `seconds_active`

* refactor: change `blocklist-update` to `blocklist_update`

* refactor: change `port-test` to `port_test`

* refactor: change `session-close` to `session_close`

* refactor: change `queue-move-top` to `queue_move_top`

* refactor: change `queue-move-up` to `queue_move_up`

* refactor: change `queue-move-down` to `queue_move_down`

* refactor: change `queue-move-bottom` to `queue_move_bottom`

* refactor: change `free-space` to `free_space`

* refactor: change `group-set` to `group_set`

* refactor: change `group-get` to `group_get`

* refactor: change `announce-ip` to `announce_ip`

* refactor: change `announce-ip-enabled` to `announce_ip_enabled`

* refactor: change `upload-slots-per-torrent` to `upload_slots_per_torrent`

* refactor: change `trash-can-enabled` to `trash_can_enabled`

* refactor: change `watch-dir-enabled` to `watch_dir_enabled`

* refactor: change `watch-dir-force-generic` to `watch_dir_force_generic`

* refactor: change `watch-dir` to `watch_dir`

* refactor: change `message-level` to `message_level`

* refactor: change `scrape-paused-torrents-enabled` to `scrape_paused_torrents_enabled`

* refactor: change `torrent-added-verify-mode` to `torrent_added_verify_mode`

* refactor: change `sleep-per-seconds-during-verify` to `sleep_per_seconds_during_verify`

* refactor: change `bind-address-ipv4` to `bind_address_ipv4`

* refactor: change `bind-address-ipv6` to `bind_address_ipv6`

* refactor: change `peer-congestion-algorithm` to `peer_congestion_algorithm`

* refactor: change `peer-socket-tos` to `peer_socket_tos`

* refactor: change `peer-port-random-high` to `peer_port_random_high`

* refactor: change `peer-port-random-low` to `peer_port_random_low`

* refactor: change `anti-brute-force-enabled` to `anti_brute_force_enabled`

* refactor: change `rpc-authentication-required` to `rpc_authentication_required`

* refactor: change `rpc-bind-address` to `rpc_bind_address`

* refactor: change `rpc-enabled` to `rpc_enabled`

* refactor: change `rpc-host-whitelist` to `rpc_host_whitelist`

* refactor: change `rpc-host-whitelist-enabled` to `rpc_host_whitelist_enabled`

* refactor: change `rpc-password` to `rpc_password`

* refactor: change `rpc-port` to `rpc_port`

* refactor: change `rpc-socket-mode` to `rpc_socket_mode`

* refactor: change `rpc-url` to `rpc_url`

* refactor: change `rpc-username` to `rpc_username`

* refactor: change `rpc-whitelist` to `rpc_whitelist`

* refactor: change `rpc-whitelist-enabled` to `rpc_whitelist_enabled`

* refactor: change `ratio-limit-enabled` to `ratio_limit_enabled`

* refactor: change `ratio-limit` to `ratio_limit`

* refactor: change `show-options-window` to `show_options_window`

* refactor: change `open-dialog-dir` to `open_dialog_dir`

* refactor: change `inhibit-desktop-hibernation` to `inhibit_desktop_hibernation`

* refactor: change `show-notification-area-icon` to `show_notification_area_icon`

* refactor: change `start-minimized` to `start_minimized`

* refactor: change `torrent-added-notification-enabled` to `torrent_added_notification_enabled`

* refactor: change `anti-brute-force-threshold` to `anti_brute_force_threshold`

* refactor: change `torrent-complete-notification-enabled` to `torrent_complete_notification_enabled`

* refactor: change `prompt-before-exit` to `prompt_before_exit`

* refactor: change `sort-mode` to `sort_mode`

* refactor: change `statusbar-stats` to `statusbar_stats`

* refactor: change `show-extra-peer-details` to `show_extra_peer_details`

* refactor: change `show-backup-trackers` to `show_backup_trackers`

* refactor: change `blocklist-date` to `blocklist_date`

* refactor: change `blocklist-updates-enabled` to `blocklist_updates_enabled`

* refactor: change `main-window-layout-order` to `main_window_layout_order`

* refactor: change `main-window-height` to `main_window_height`

* refactor: change `main-window-width` to `main_window_width`

* refactor: change `main-window-x` to `main_window_x`

* refactor: change `main-window-y` to `main_window_y`

* refactor: change `filter-mode` to `filter_mode`

* refactor: change `filter-trackers` to `filter_trackers`

* refactor: change `filter-text` to `filter_text`

* refactor: change `remote-session-enabled` to `remote_session_enabled`

* refactor: change `remote-session-host` to `remote_session_host`

* refactor: change `remote-session-https` to `remote_session_https`

* refactor: change `remote-session-password` to `remote_session_password`

* refactor: change `remote-session-port` to `remote_session_port`

* refactor: change `remote-session-requres-authentication` to `remote_session_requires_authentication`

* refactor: change `remote-session-username` to `remote_session_username`

* refactor: change `torrent-complete-sound-command` to `torrent_complete_sound_command`

* refactor: change `torrent-complete-sound-enabled` to `torrent_complete_sound_enabled`

* refactor: change `user-has-given-informed-consent` to `user_has_given_informed_consent`

* refactor: change `read-clipboard` to `read_clipboard`

* refactor: change `details-window-height` to `details_window_height`

* refactor: change `details-window-width` to `details_window_width`

* refactor: change `main-window-is-maximized` to `main_window_is_maximized`

* refactor: change `port-is-open` to `port_is_open`

* refactor: change `show-tracker-scrapes` to `show_tracker_scrapes`

* refactor: change `max-peers` to `max_peers`

* refactor: change `peers2-6` to `peers2_6`

* refactor: change `seeding-time-seconds` to `seeding_time_seconds`

* refactor: change `downloading-time-seconds` to `downloading_time_seconds`

* refactor: change `ratio-mode` to `ratio_mode`

* refactor: change `idle-limit` to `idle_limit`

* refactor: change `idle-mode` to `idle_mode`

* refactor: change `speed-Bps` to `speed_Bps`

* refactor: change `use-global-speed-limit` to `use_global_speed_limit`

* refactor: change `use-speed-limit` to `use_speed_limit`

* chore: remove TODO comment

* docs: add upgrade instructions to `5.0.0`

* chore: bump rpc semver major version

* chore: housekeeping
2025-12-01 16:08:18 -06:00
Charles Kerr
73e6892a74 refactor: let client pass in translated string of None when calling tr_strratio() (#7805) 2025-11-14 10:04:04 -06:00
Cœur
78238ec3de fix corruption: torrentVerify on completion (#4178)
* torrentVerify on completion

* Make torrent verify on completion configurable via settings

* code review: replacing tr_verify_complete_mode with bool

* code review: sorting torrent_complete_verify_enabled with bool

* Update Application.cc

* code review: avoiding `session->onTorrentCompletenessChanged` before verification completion
2025-11-10 14:16:15 -06:00
niol
a7a5bc38ad fix: ChangeFlag bitwise operations (#7613)
* unbreak ChangeFlag bitwise operations (Fix #7572)

8 bits is not enough to do bitwise comparisons on more than 8 independent
values: use std:bitset to ensure proper bitwise operations inside
ChangeFlags().

* refactor: use bitset methods and specify TR_CONSTEXPR23

---------

Co-authored-by: Yat Ho <lagoho7@gmail.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2025-10-14 19:38:52 -05:00
Yat Ho
fb25228f24 chore: bump {fmt} to 11.2.0 and fix compatibility (#7612)
* chore: bump fmt to 11.2.0

Acquire 6797f0c39a, which fixes compile error on GCC 15.1.

Acquire
9f269062a7,
which fixes buffer overflow in NetBSD 10.1 on GCC 10.5.

Replace `fmt::localtime` with `std::localtime`, as `fmt::` is now
deprecated.

* fix: format timezone ourselves on Windows

{fmt} 11.2.0 removed the ability to format `std::tm` with the format specifier `%z` on Windows, for a good reason. Ref: https://github.com/fmtlib/fmt/issues/4444

This forces us to implement our own solution on Windows as there's no alternative.

* fix: support `FMT_USE_EXCEPTIONS`
2025-10-14 12:53:08 -05:00
Yat Ho
08ec7fb7c7 build: lint header files with clang-tidy (#7527)
* build: clang-tidy headers when building libtransmission

* chore: revert `= default` workaround

It was introduced in 6909ec0bad to fix build issues with macOS 10.14. We
no longer support that version.

* fix: clang-tidy warnings for libtransmission

* build: clang-tidy headers when building tests

* fix: clang-tidy warnings for tests

* build: clang-tidy headers when building qt

* code review: don't manually edit mime-types.h

* code review: unify variable naming for static private members
2025-05-07 22:10:16 +01:00
Yat Ho
adea0e2a07 build: tell clang-tidy to suggest uppercase literal suffixes (#7529) 2025-05-06 22:07:43 +01:00
Yat Ho
c215de34d5 chore: move away from fmt/core.h (#7557) 2025-05-06 01:01:12 -05:00
Yat Ho
7b83c7d625 refactor: rename unreleased quarks to snake_case (#7483)
* refactor: rename `sequentialDownload` to `sequential_download`

* refactor: rename `beginPiece` to `begin_piece`

* refactor: rename `endPiece` to `end_piece`

* refactor: rename `ipProtocol` to `ip_protocol`

* refactor: rename `preferred-transport` to `preferred_transport`
2025-03-10 17:30:19 -05:00