Minor optimization: since we don't actually change our request headers
very often, we can lazy-build the request once and reuse that instead of
having to rebuild it each time.
Explicitly delete the implied function to ensure we don't get bitten by
this again in the future.
Mark the string_views constexpr where possible so that we can avoid some
strlen() calls at runtime.
* chore: fix deprecation warnings of GTK_STOCK_ use.
This is just a tiny step towards getting all of the GTK code up-to-date,
but GTK_STOCK warnings are the lowest-hanging fruit of the warnings, so
let's fix them.
* refactor: make variant_headers reusable to qt app.
Torrent.cc's `change()` template methods are generically useful to deal
with tr_variant wrangling, but previously were only used in Torrent.cc.
This PR moves them into a new API `VariantHelpers.h` for use by Prefs,
Session, TorrentModel, etc.
* refactor: Torrent::update() returns a delta bitset
Setting up for followup PRs where, instead of doing expensive work every
time there is a change, we can be more fine-grained and do the work only
if the relevant Torrent properties changed.
* chore: make uncrustify happy
* refactor: update filterbar counts more selectively
Only rebuild the activity and tracker combobox models when the model's
size changes or when the relevant Torrent properties change.
Previously, rebuild would happen on any Torrent property change even if
the properties were unrelated to activity or trackers.
* chore: remove redundant "private:" key
* refactor: Torrent::update() returns a delta bitset
Setting up for followup PRs where, instead of doing expensive work every
time there is a change, we can be more fine-grained and do the work only
if the relevant Torrent properties changed.
* chore: make uncrustify happy
* chore: fix #includes
* refactor: faster action sensitivity updates
Currently we walk through every row in the model and pump its TorrentRole data, which can be expensive for long lists. However since we're only interested in the selected rows, let's save some traversal overhead by getting that list directly and walking it instead.
edit-date got added to the backend in 3.00, but I never finished adding
it properly to the Qt client. This PR rectifies that. When a torrent is
edited, the Application and DetailsDialogs will re-query the backend to
update the torrent properties that are needed.
* refactor: use snake_case field naming in qt client
* fix: some missed symbols
* chore: make uncrustify happy
* fixup! refactor: use snake_case field naming in qt client
* chore: remove qvariants from torrent class
* chore: remove unused Q_DECLARE macro calls
* refactor: remove unused includes from Torrent.h
* chore: make clang-tidy and linter happy
* refactor: rename 'setValue()' to 'change()'
* refactor: make tr_variant function paramters const
* chore: remove devel scaffolding
* refactor: rename peer_limit_ to peerLimit_
* refactor: do not use bitwise logic on booleans
GTK client: none.
Qt client: Finnish.
Mac client: none (there're suitable languages, but they're lacking XIB files
and we haven't switched to base localization yet).
* crypto-utils: do tr_rand_int without abs
There is really not much point in trying to abs a random int when you can just interpret it as unsigned in the first place.
* fixup! trailing space
how did this get in here?
* fixup! unsigned int
Co-authored-by: Charles Kerr <charles@charleskerr.com>
* chore: fix markdown headers in NEWS.md
* chore: turn closed pulls/issues into links
* chore: linkify the release headers
* chore: fill in the 3.00 release date
* chore: use 'NEWS.md' in build scripts
* chore: tweak date format to YYYY-MM-DD
GTK client: none.
Qt client: Japanese.
Mac client: none (there're suitable languages, but they're lacking XIB files
and we haven't switched to base localization yet).
* perf: lazy-update actions enabled on change events
Actions' sensitivity was being lazy-updated in response to other events
but accidentally were doing immediate updates in response to torrentsChanged
signals being emitted from TorrentModel. This commit makes that path a
lazy-update as well.
* chore: uncrustify
* refactor: make the idle updater a lambda again
Previously it was calculated from `log10(1.0 / DBL_EPISILON) - 1`;
however, there's no need to calculate it out when there's an ANSI
standard that already spells it out consisely.
In libtransmission/variant.c, function tr_variantWalk, when the variant
stack is reallocated, a pointer to the previously allocated memory
region is kept. This address is later accessed (heap use-after-free)
while walking back down the stack, causing the application to crash.
The application can be any application which uses libtransmission, such
as transmission-daemon, transmission-gtk, transmission-show, etc.
Reported-by: Tom Richards <tom@tomrichards.net>