409 Commits

Author SHA1 Message Date
Charles Kerr
76a7994eef refactor: remove tr_free() (#3668) 2022-08-18 09:14:12 -05:00
Charles Kerr
963a8112a1 refactor: remove tr_strvDup() (#3666) 2022-08-17 21:18:44 -05:00
Charles Kerr
bfec98c323 refactor: avoid tr_new() in transmission-remote (#3665) 2022-08-17 20:25:42 -05:00
Charles Kerr
7fe2cf68b9 refactor: avoid tr_new(), tr_free() in tr_variant (#3663)
* refactor: remove unused tr_renew()

* refactor: remove unused tr_realloc()

* refactor: avoid tr_strvDup() in tr-quark
2022-08-17 14:44:18 -05:00
Charles Kerr
6b25a57899 refactor: don't use tr_free in tr_strvUtf8Clean() (#3658) 2022-08-16 21:47:07 -05:00
Charles Kerr
e49747ab51 feat: add tr_strvToBuf() (#3657)
* feat: add tr_getDefaultConfigDirToBuf()

* feat: add tr_getDefaultDownloadDirToBuf()

* feat: add tr_strvToBuf()

* feat: add tr_torrentFindFileToBuf()

* feat: add tr_torrentGetMagnetLinkToBuf()

* refactor: remove unused makeString() from tests

* feat: add tr_torrentFilenameToBuf()

* feat: add tr_torrentGetTrackerListToBuf()

* chore: remove obsolete comment references to tr_free

* chore: remove unused tr_strdup()

* chore: remove unused forward declarations
2022-08-16 19:28:57 -05:00
Charles Kerr
c625ec7e0f refactor: make tr_session.rpc_server_private_ (#3646)
* refactor: make tr_session.rpc_server_ private

* chore: sort some fields to reduce number of padding holes

* chore: remove unused forward declarations

* refactor: aggregate tr_bitfield in tr_turtle

* chore: remove unused forward declarations

* chore: remove unused forward declarations
2022-08-15 16:25:55 -05:00
Charles Kerr
63eab54fd5 refactor: timer pt 2 (#3617)
* feat: add convenience variants of TimerMaker::create()

* refactor: use libtransmission::Timer in peer-mgr

* refactor: use libtransmission::Timer in peer-msgs

* refactor: use libtransmission::Timer in tr-utp

* refactor: use libtransmission::Timer in tr-dht

* refactor: use libtransmission::Timer in port-forwarding

* refactor: use libtransmission::Timer in webseed

* refactor: use libtransmission::Timer in tr-lpd

* refactor: use libtransmission::Timer in rpc-server

* chore: remove unused function tr_timerAdd()

* chore: remove unused function tr_gettimeofday()

* fixup! chore: remove unused function tr_timerAdd()

* fixup! refactor: use libtransmission::Timer in port-forwarding
2022-08-11 12:28:37 -05:00
Charles Kerr
c66303fae2 refactor: watchdir (#3606) 2022-08-10 08:34:51 -05:00
Charles Kerr
83ffa6bf1b chore: fix spdx abbreviations (#3602) 2022-08-08 13:05:39 -05:00
Charles Kerr
4bc1589c5d refactor: remove tr_win32_utf8_to_native_ex() (#3590) 2022-08-05 14:16:25 -05:00
Charles Kerr
8b983b3d1c refactor: tr_sys_path_resolve() returns a std::string (#3587)
* refactor: tr_sys_path_resolve returns std::string
2022-08-05 11:36:01 -05:00
Charles Kerr
ef34c7c4dc refactor: use std::wstring on win32 (#3578) 2022-08-03 18:07:38 -05:00
Charles Kerr
dab81c1af6 fix: readability-inconsistent-declaration-parameter-name warnings in libtransmission (#3572) 2022-08-03 01:15:37 -05:00
Charles Kerr
fa6ba14dc3 refactor: remove closure struct in tr-dht (#3550)
This was the last use of tr_memdup(), so remove that too
2022-07-29 14:38:43 -05:00
Charles Kerr
e0ca366b2d refactor: remove tr_loadFile() (#3540)
* refactor: use the std::vector variant of tr_loadFile() in rpc-server.cc

* refactor: use the std::vector variant of tr_loadFile() in rename-test.cc

* refactor: remove the unused raw ptr variant of tr_loadFile()
2022-07-28 14:22:32 -05:00
Charles Kerr
0e7ef51d5c refactor: tr_env_get_string() now returns a std::string (#3527) 2022-07-26 23:26:37 -05:00
Charles Kerr
9bf2918ad0 refactor: remove tr_strvPath() (#3509) 2022-07-22 13:07:23 -05:00
Charles Kerr
2293f4336a perf: use fast_float to parse floating-point numbers (#3092) 2022-05-16 00:06:17 -05:00
maxz
d8c5c65725 Specify the umask and IPC socket permission as strings. (#2984)
* Support specifying the umask as a string representing an octal number.

* Save the umask as a string representing an octal number.

* Support specifying the IPC socket permission as a string representing an octal number.

* Save the IPC socket permission as a string representing an octal number.

* Add a `base` parameter to `tr_parseNum()` for specifying the radix.
2022-04-28 09:16:19 -05:00
Charles Kerr
aa2bb367ab chore: iwyu cleanup (#2981) 2022-04-24 20:49:52 -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
Charles Kerr
ed897f93f2 refactor: remove evbuffer_free_to_str() (#2967) 2022-04-22 13:05:49 -05:00
Antoine Cœur
bdac708762 docs: fix various typos and misspellings (#2955) 2022-04-21 09:28:38 -05:00
Charles Kerr
2f97655981 refactor: remove tr_url_parsed_t.portstr (#2929) 2022-04-16 13:13:42 -05:00
Charles Kerr
2866638e1b refactor: add tr_torrent_files::move() and remove() (#2919) 2022-04-15 18:39:04 -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
b256da02e3 refactor: remove unused macros (#2897)
* refactor: remove unused fu nction tr_lowerBound()

* refactor: tr_timerAdd() takes a reference, not a pointer

* refactor: tr_timerAddMsec() takes a reference, not a pointer

* refactor: tr_moveFile() takes a reference, not a pointer

* refactor: tr_wildmat() takes std::string_views

* refactor: remove unused macro TR_GNUC_NONNULL

* refactor: remove unused macro TR_GNUC_PRINTF

* refactor: remove unused macro TR_GNUC_NULL_TERMINATED

* refactor: remove unused macro TR_GNUC_HOT

* refactor: remove unused macro __has_feature

* refactor: remove unused macro __has_attribute

* refactor: remove unused macro TR_DEPRECATED

* refactor: remove unused macro TR_DISABLE_COPY_MOVE
2022-04-07 19:20:29 -05:00
Charles Kerr
31c65eec1f refactor: remove tr_strvJoin() (#2896) 2022-04-07 17:26:59 -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
7ff1382503 refactor: remove tr_strcmp0() (#2882) 2022-04-05 12:45:26 -05:00
Charles Kerr
80dd460773 refactor: annotate nodiscard, constexpr, noexcept methods (#2879) 2022-04-04 22:51:56 -05:00
Charles Kerr
68bec3f8e3 refactor: remove tr_snprintf() (#2872) 2022-04-04 13:36:48 -05:00
Charles Kerr
1d7d17396f refactor: remove tr_snprintf() pt 2 (#2871) 2022-04-03 13:23:00 -05:00
Charles Kerr
e64430941f refactor: remove tr_strdup_printf() (#2854) 2022-03-31 19:13:37 -05:00
Charles Kerr
977b2a1bab refactor: tr_loadFile() tr_saveFile() take a std::string_view filename arg (#2822)
* refactor: tr_saveFile takes a string_view

* refactor: tr_saveFile, tr_loadFile take string_view filename
2022-03-25 19:31:27 -05:00
Charles Kerr
72a67054ea refactor: fmt part 2 (#2771) 2022-03-15 09:52:16 -05:00
Charles Kerr
a942c67199 refactor: use fmt (#2758)
* deps: use fmt (8.1.1 tag) to build log strings

Co-authored-by: Mike Gelfand <mikedld@mikedld.com>
2022-03-13 23:43:35 -05:00
Charles Kerr
02b6cc76d1 feat: add tr_torrentSetTrackerList(), tr_torrentGetTrackerList() (#2642)
Add a getter/setter for torrent announce URLs as text that can be copied
and pasted: one URL per line, with a blank line between tiers.

C API: tr_torrentGetTrackerList() and tr_torrentSetTrackerList()
RPC APi: `trackerList` in `torrent-get` and `torrent-set`.

This deprecates `trackerAdd`, `trackerRemove`, and `trackerEdit`
from the RPC API.
2022-02-18 11:52:01 -06:00
Charles Kerr
878405f862 Revert "fix: sonarcloud (#2558)" (#2562)
This reverts commit 8b9483f7fb.
2022-02-01 11:30:51 -06:00
Charles Kerr
8b9483f7fb fix: sonarcloud (#2558)
* fix: add const modifier for functions

* fix: many sonarcloud use-init-statement warnings
2022-01-31 22:46:27 -06:00
Charles Kerr
b645c4cfc5 refactor: use std::chrono not OS-specific syscalls (#2554) 2022-01-31 19:02:59 -06:00
Charles Kerr
7bc668680e chore: remove unused function tr_strcasestr() (#2552) 2022-01-31 15:59:14 -06:00
Charles Kerr
253f4fe009 chore: remove /upload endpoint from rpc-server (#2550)
It's never been documented or supported and is unused by the web client.

In the unlikely case that a 3rd party app is using it, use 'torrent-add'
instead; it's documented + supported.
2022-01-31 14:54:21 -06:00
Charles Kerr
df1cca9b57 chore: update copyright years, make notices consistent (#2463) 2022-01-20 12:27:56 -06:00
Charles Kerr
db23ca4c6b refactor: replace tr_info with tr_torrent_metainfo (#2397)
* refactor: replace tr_info with tr_torrent_metafo
2022-01-15 13:33:57 -06:00
Charles Kerr
49f2823d6f refactor: use std::string in tr_info (#2384) 2022-01-08 17:41:05 -06:00
Charles Kerr
a5c6168805 refactor: make tr_buildPath() private (#2374) 2022-01-02 11:51:59 -06:00
Mike Gelfand
d8d361e491 Make some utility functions return std::string to simplify code (#2368)
* tr_formatter_speed_KBps returns std::string

* tr_formatter_mem_B returns std::string

* tr_formatter_size_B returns std::string

* tr_strpercent/tr_strratio returns std::string
2021-12-31 03:30:21 +03:00
Charles Kerr
46f9582e36 refactor: prefer std::from_chars over strtoul (#2359) 2021-12-29 02:28:12 -06:00