* 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
* feat: sync the values of `preferred_transports` and `*_enabled`
* refactor: avoid using `tr_session::allowsTCP()`
* code review: implement fixup methods in source file
* refactor: remove Session::addKeyName()
refactor: remove Session::removeKeyName()
these should have been removed a long time ago
* fix: better logging on error in Converters
* refactor: add Qt-app-specific variant converters
* refactor: use tr_variant::unmanaged_string(tr_quark) when in torrent_get table mode
* perf: in rpcimpl, use tr_variant::unmanaged_string() for unit strings
* perf: in rpcimpl, use tr_variant::unmanaged_string() encryption mode
* perf: in rpcimpl, use tr_variant::unmanaged_string() for TrRpcVersionSemver
* refactor: libtransmission::serializer redesign
This is a followup to bf48eadaeb with several goals.
- `Converters` now has container-like concepts to make it Just Work
when a user tries to convert containers of T, e.g. std::vector<T>,
std::set<T>, QStringList, small:vector<T>, etc.
- `Fields` are now stored in a std::tuple instead of a std::array.
This has two important benefits:
1. `Fields` are smaller and can be made constexpr / consteval
2. We no longer need to use type erasure. The void pointer casts
and typeinfo lookups are gone and the new code is typesafe.
- naming cleanup:
- renamed the namespace to `libtransmission::serializer`.
- renamed the file to `serializer.h`
- renamed the tr_variant<->T converter registry class to `Converters`.
- removed use of the CRTP. You can now serialize any struct
without having to subclass `Serializable`.
I think I am done refactoring this for awhile.
* fix: naming is hard
docs: better code comments
* fix: clang-tidy readability-identifier-naming
* Update tests/libtransmission/serializer-tests.cc
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* refactor: remove tr_variant<->int converter
* improve tests
---------
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* feat: Qt client now formats RPC requests in the RPC server's preferred style
* add macro to build TrRpcVersionSemver
Co-authored-by: Yat Ho <lagoho7@gmail.com>
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.
* 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
* test: add benc2cpp.py, a benc beautifier for hardcoded cpp test cases
* test: add .resume file unit test
* refactor: use api_compat::convert_incoming_data() and convert_outgoing_data() on .resume files
* chore: mark TR_KEY_peers2_6_kebab as APICOMPAT
* chore: mark TR_KEY_speed_Bps_kebab as APICOMPAT
* chore: mark TR_KEY_use_speed_limit_kebab as APICOMPAT
* chore: mark as APICOMPAT: TR_KEY_use_global_speed_limit_kebab
* chore: mark as APICOMPAT: TR_KEY_ratio_mode_kebab
* chore: mark as APICOMPAT: TR_KEY_idle_limit_kebab
* chore: mark as APICOMPAT: TR_KEY_idle_mode_kebab
* chore: mark as APICOMPAT: TR_KEY_max_peers_kebab
* chore: mark as APICOMPAT: TR_KEY_added_date_kebab
* chore: mark as APICOMPAT: TR_KEY_seeding_time_seconds_kebab
* chore: mark as APICOMPAT: TR_KEY_downloading_time_seconds_kebab
* chore: mark as APICOMPAT: TR_KEY_bandwidth_priority
* chore: mark as APICOMPAT: TR_KEY_done_date_kebab
* chore: mark as APICOMPAT: TR_KEY_activity_date_kebab
* chore: remove remaining _kebab cases from resume.cc
* chore: clang-format
* Enable FreeType and Harfbuzz for Windows release builds
This fixes icon font glyphs rendering in Qt client.
* Bump Qt to 6.10.1
* Use pixel sizes for icon font glyphs rendering on Windows
The glyphs otherwise turn out of a smaller, non-standard size which
makes them less crisp.
Add a module to convert between tr4 and tr5 RPC / settings / config file payloads.
This will be used as a compatibility layer between Transmission 5's naming scheme
and Transmission <= 4.
Co-authored-by: Yat Ho <lagoho7@gmail.com>
Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
* refactor: replace Settings class with Serializable
* Fields can now be declared as const static,
so we only have to build this list once per class
instead of once per iteration.
* Add typesafe single-property getters & setters.
* Split the converter registry into a generic standalone class.
* refactor: make Serializable::Field::getter private
refactor: make Serializable::Field::const_getter private
* docs: tweak code comments
* refactor: make Serializable::Field::Getter private
refactor: make Serializable::Field::ConstGetter private
refactor: make Serializable::Field::MemberStorage private
* chore: fix readability-identifier-naming clang-tidy warnings
* Update libtransmission/serializable.h
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* Update libtransmission/serializable.h
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* Update libtransmission/serializable.h
Co-authored-by: Yat Ho <lagoho7@gmail.com>
* fixup! Update libtransmission/serializable.h
---------
Co-authored-by: Yat Ho <lagoho7@gmail.com>