Commit Graph

1891 Commits

Author SHA1 Message Date
Charles Kerr 47fe7c47d2
refactor: replace per-torrent callbacks with per-session ones. (#3495) 2022-07-23 01:04:34 -05:00
Charles Kerr 445aad56a0
test: add platform tests (#3514)
* test: add tr_getDefaultDownloadDir() tests

this also indirectly tests xdg and homedir

* test: add PlatformTest.defaultConfigDirEnv

* test: add PlatformTest.defaultConfigDirXdgConfig

test: add PlatformTest.defaultConfigDirXdgConfigHome

* test: add PlatformTest.webClientDirEnvClutch

test: add PlatformTest.webClientDirEnvTr

test: add PlatformTest.webClientDirXdgDataHome

* fixup! test: add PlatformTest.webClientDirEnvClutch

fix: win32 breakage
2022-07-22 20:10:02 -05:00
Charles Kerr 0da1cbb6ec
fix: 3508 location invalidation (#3511)
* Revert "refactor: remove tr_sessionGetConfigDir() (#3506)"

This reverts commit c50da43ae0.

* Revert "fix: do not leak in tr_getWebClientDir() (#3502)"

This reverts commit 5a75e37033.
2022-07-22 00:52:48 -05:00
Charles Kerr c50da43ae0
refactor: remove tr_sessionGetConfigDir() (#3506)
* refactor: remove tr_sessionGetConfigDir() from GTK client

* refactor: remove tr_sessionGetConfigDir() from daemon

* refactor: remove tr_sessionGetConfigDir()

* refactor: remove tr_getTorrentDir()

* fixup! refactor: remove tr_sessionGetConfigDir()
2022-07-21 20:12:45 -05:00
David Miguel Susano Pinto f8b3514c0e
tr_makeMetaInfo: new anonymize option (closes #3420) (#3452) 2022-07-19 16:48:24 -05:00
Charles Kerr 3f07838be8
fixup! refactor: use fmt to build the GTK client's user-visible strings (#2788) (#3469)
fix: invalid fmt type when downloading metadata
2022-07-18 10:33:11 -05:00
Gary Elshaw 46874dff91
Keep the GTK icon and ico files consistent (#3457)
* GTK ico

Restoring the more contemporary GTK icon makes some sense after being in GTK for the last while. Current 3.0 builds in flatpak, snap etc are using it, and having the client and tray match seems right.

* Updated the svg -> ico conversion method for better scaling
2022-07-16 14:10:42 -05:00
Gary Elshaw 0c9ca9ac30
Body text changes (#3431)
While i'm in Manjaro Linux and working on the GTK client for a little while, i noticed Linux wasn't included as a platform in the file, and the repetition of frontend and backend was annoying me.

Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-07-10 23:16:35 -05:00
Charles Kerr 36b70ed137
refactor: use svg icons in GTK client (#3395) 2022-07-03 17:14:13 -05:00
Charles Kerr 88a3149ce4
refactor: add tr_peer.activeReqCount() (#3373)
rename peer_stats.pendingReqs to .activeReqs for consistency
2022-06-28 20:48:39 -05:00
Dzmitry Neviadomski 534f9f7bc1
Update Copyright Year to 2022. (#3352) 2022-06-28 09:07:12 -05:00
FX Coudert b893289392
Rename Mac OS X to macOS (#3362) 2022-06-27 15:28:37 -05:00
Charles Kerr 25fdb5805c
refactor: use tr_torrent_id_t (#3314)
* refactor: use semantic type tr_torrent_type_t in libtransmission

* refactor: use semantic type tr_torrent_type_t in gtk client

* refactor: use semantic type tr_torrent_type_t in qt client
2022-06-17 10:43:04 -05:00
Charles Kerr b85edf8d0f
fix: add i18n options for past tense, future tense time (#3245) 2022-06-14 21:56:27 -05:00
Balázs Meskó 0df6c23c7b
fix: mark non-c-strings for gettext i18n (#3210) 2022-06-08 01:04:17 -05:00
orbital-mango 49b62319c3
feature: add missing accelerators for File menu (GTK) (#3213) 2022-06-07 12:17:35 -05:00
Charles Kerr 2ff4041074
fixup! fix: coverity warnings (#3168) (#3193) 2022-06-04 11:33:03 -05:00
orbital-mango 12bf2896b6
feature: add piece size selection on torrent creation (GTK) (#3145) 2022-06-01 09:11:30 -05:00
Charles Kerr 84d65d8e61
fix: coverity warnings (#3168)
* fix: uninitialized peer_atom field

* fix: silence inaccurate open-files-test warning

* fix: assertion-is-always-true

asserting unsigned val is >= 0

* fix: unnecessary nullptr check

* fix: nullptr dereference warning
2022-05-31 18:58:20 -05:00
orbital-mango b4624cc775
fix: GTK file list size and progress % regression (#3127) 2022-05-25 13:27:33 -05:00
Gary Elshaw de4148a697
chore: update GTK client icon to match Big Sur icon 2022-05-24 19:04:56 -05:00
orbital-mango 0f29958751
Show torrent added date/time in details dialog (GTK). (#3124)
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2022-05-23 11:09:21 -05:00
Charles Kerr c0bb2d40f1
refactor: add pathbuf and std::string-friendly helpers to tr_sys file and path funcs (#3118)
* refactor: add sv-friendly tr_sys_dir_create() variant

* refactor: add sv-friendly tr_sys_path_get_info() variant

* refactor: add sv-friendly tr_sys_path_exists() variant

* refactor: add sv-friendly tr_sys_path_remove() variant

* refactor: add sv-friendly tr_sys_path_rename() variant

* fixup! refactor: add sv-friendly tr_sys_path_rename() variant
2022-05-21 20:17:00 -05:00
Charles Kerr a28b07b390
Revert "refactor: move tr_torrent callbacks to tr_session (#3003)" (#3104)
This reverts commit 27fbfd8da6.

Fixes #3088.
2022-05-16 13:48:43 -05:00
Charles Kerr e286e45ac8
fixup! refactor: use smaller integral types in some structs (#3005) (#3096)
fix GTK client file progress % regression

Fixes #3063.
2022-05-16 09:06:18 -05:00
Charles Kerr 27fbfd8da6
refactor: move tr_torrent callbacks to tr_session (#3003)
* refactor: move tr_torrent callbacks to tr_session

* Support tr_sessionSet* (#3044)

Co-authored-by: Antoine Cœur <coeur@gmx.fr>
2022-05-14 10:00:13 -05:00
Charles Kerr bf655a921d
refactor: use smaller integral types in some structs (#3005) 2022-04-27 20:06:51 -05:00
Charles Kerr 20be816fee
perf: faster file-lists in the GTK client's details dialog (#2993)
* perf: faster file tree building in GTK client

* perf: faster GTK client FileList

* use a std::map for faster node lookup when building a file tree

* use tr_get_mime_type_for_filename() for mime-type lookup

* remove unnecessary layer of indirection when building the
  keys for lookuops in the mime-type icon cache

* be more careful to only call operator= on proxies whose values
  have actually changed, since that assignment is expensive
2022-04-26 18:24:07 -05:00
Antoine Cœur 42713c6716
OS X → macOS (#2986) 2022-04-26 09:11:44 -05:00
Antoine Cœur c708b83a3f
update documentation links (#2985) 2022-04-25 18:18:35 -05:00
Charles Kerr aa2bb367ab
chore: iwyu cleanup (#2981) 2022-04-24 20:49:52 -05:00
Charles Kerr 4f70baa27e
fix: cell-renderer up/down ui layout order (#2970) 2022-04-22 22:41:30 -05:00
Charles Kerr 1ebac744a5
build: re-enable cert-err33-c clang-tidy warning (#2968)
* refactor: re-enable cert-err33-c clang-tidy warning

* refactor: use fmt::chrono in transmission-remote

* refactor: use fmt::chrono in transmission-show

* refactor: use fmt::chrono in GTK details dialog

* refactor: use fmt::chrono in tr_session

* refactor: remove tr_localtime_r

* refactor: remove tr_gmtime_r
2022-04-22 14:56:54 -05:00
Antoine Cœur bdac708762
docs: fix various typos and misspellings (#2955) 2022-04-21 09:28:38 -05:00
Charles Kerr f4bb09428b
fixup: more libfmt usage regressions (#2924) 2022-04-15 19:56:16 -05:00
Charles Kerr 205abbbcce
refactor: iwyu string, vector, cstdint (#2898)
* refactor: use cstdint for intX_t types

* refactor: iwyu sstring_view

* refactor: iwyu <cstring>

* refactor: iwyu <vector>
2022-04-07 20:50:26 -05:00
Charles Kerr ffda5bb68a
refactor: remove tr_strip_positional_args() (#2881)
* refactor: use fmt in gtk/SystemIconTray

* refactor: use fmt in gtk/MakeDialog

* refactor: remove unused tr_strip_positional_args()

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-04-07 08:23:04 -05:00
Charles Kerr a71f0c762d
refactor: remove varargs from libtransmission (#2876)
* refactor: do not use va_arg in peer-msgs.cc

* refactor: do not use va_arg in platform.cc

* build: enable cert-dcl50-cpp clang-tidy warning

* refactor: use some tr_pathbuf where sensible
2022-04-04 20:37:12 -05:00
Charles Kerr 76f44b4b6f
fix: sonarcloud (#2868)
* refactor: make this variable const

* refactor: replace redundant type with auto

* refactor: use the nullptr literal

* refactor: replace declaration by structured binding declaration
2022-04-02 17:42:51 -05:00
Charles Kerr 1cc9da26ba
fix: sonarcloud (#2865)
* refactor: implement FileTreeItem::children_ with a std::vector

* fix: std::move should not be called on forwarding reference

* fix: uninitialized scalar variable

* fix: unchecked return value from library

* fix: dereference before null check

* fix: unchecked return value from library

* fix: unchecked return value from library

* fixup! refactor: implement FileTreeItem::children_ with a std::vector

* fix: signed-unsigned comparison in libtransmission tests

* fix: avoid unnecessary copy by using const reference

* fix: function should be declared const

* refactor: use fmt::format to build log timestamps

* fix: use init-statement to reduce variable scope

* fixup! refactor: use fmt::format to build log timestamps

* fix: remove tau_tracker destructor for rule-of-zero

* fix: remove tr_peerIo destructor for rule-of-zero

* Revert "fix: dereference before null check"

This reverts commit cd78967815.

* fix: signed-unsigned comparison in libtransmission tests

* fix: use init-statement to reduce variable scope

* fix: extract nested code block into separate method

* fix: extract nested code block into separate method

* fix: extract nested code block into separate method

* fix: use init-statement to reduce variable scope

* fix: extract nested code block into separate method

* fix: signed-unsigned comparison in libtransmission tests

* fixup! fix: extract nested code block into separate method

* fix: mark possibly-unused as [[maybe_unused]]

* fix: invalid stack memory reference in tr_found_file_t

* fix: signed-unsigned comparison in libtransmission tests
2022-04-02 09:06:02 -05:00
Charles Kerr a250690f30
fix: sonarcloud (#2860)
* fix: break will never be executed

* fix: rewrite rimraf() to be non-throwing

* fix: conditional operation returns same value whether condition is true or false

* fix: use std::array instead of a C-style array

* fix: remove redundant access specifier

* fix: replace switch with if for readability

* fix: convert integer literal to a bool literal

* fix: replace const std::string reference to std::string_view

* fix: remove redundant access specifier

* fix: replace const std::string reference to std::string_view

* fix: remove unused parameter

* fix: remove redundant access specifier

* fix: use std::array instead of C-style array

* fix: remove redundant access specifier

* fix: replace const std::string reference with std::string_view

* fix: remove redundant access specifier

* fix: use std::array instead of C-style array

* fix: remove redundant access specifier

* fix: replace const std::string reference to std::string_view

* fix: remove redundant access specifier

* fix: merge if statement with enclosing one

* chore: clang-format

* chore: clang-format

* Revert "fix: remove redundant access specifier"

This reverts commit 054e4e7eec.

* Revert "fix: remove redundant access specifier"

This reverts commit 2c92f227e8.

* Revert "fix: remove redundant access specifier"

This reverts commit a0710202a8.

* Revert "fix: remove redundant access specifier"

This reverts commit 54da1d9397.

* Revert "fix: remove redundant access specifier"

This reverts commit f7b1777578.

* Revert "fix: remove redundant access specifier"

This reverts commit ad8e3dfff4.

* chore: revert access specifier change
2022-04-01 14:16:33 -05:00
Charles Kerr 6da591fe57
fixup! refactor: use fmt to build the GTK client's user-visible strings (#2788) (#2859)
fix: formattted speeds and percentages
2022-04-01 11:29:05 -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 3dadeae700
fix: file progress in GTK Details dialog (#2838) 2022-03-29 20:52:24 -05:00
Charles Kerr 71ad42b1ef
refactor: make err arg optional in tr_sys_* funcs (#2827) 2022-03-27 12:37:29 -05:00
Charles Kerr 7905244320
fix: missing fmt::arg calls in GTK client (#2819) 2022-03-25 12:16:29 -05:00
Charles Kerr b94c6796c8
fix: sonarcloud warnings (#2815)
* fix: add default case to switch statement

* fix: remove redundant static specifier

* fix: use std::optional.value_or

* fix: make type of variable pointer-to-const

* refactor: move log state into a struct

* refactor: make tr_peerMgr constructor explicit

* fix: make type of variable pointer-to-const

* fix: replace insert with try_emplace

* fix: implicit conversion may lose precision

* fix: use init-statement to reduce variable scope

* chore: mark unused return value with (void)
2022-03-25 00:24:04 -05:00
Charles Kerr 6e8f9f3ff0
feat: add tr_strbuf (#2810)
* feat: add tr_strbuf class for building tmp strings

Based on fmt::basic_memory_buf, this is a growable string buffer that
has an initial size that's large enough to build most filenames or URLs
without needing heap allocations.

Adds a couple of extra helpers such as a `c_str()` method to make dealing
with old zero-terminated string APIs easier.
2022-03-24 16:41:29 -05:00
Charles Kerr b8c3778cf4
fix: sonarcloud warnings (#2804)
* fix: break will never be executed

* refactor: compile the name fallback string

* fix: replace redundant type with auto

* fix: use init-statement to reduce variable scope

* fix: implicit conversion loses precision

* fix: use in-class initializer

* fix: make variable a pointer-to-const

* fix: local variable name shadows class variable

* fix: implicit conversion may lose precision
2022-03-24 00:18:41 -05:00
Charles Kerr fcc1510ecb
refactor: use fmt to build the GTK client's user-visible strings (#2788)
Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-03-21 09:15:48 -05:00