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
This commit is contained in:
Charles Kerr
2025-12-09 11:48:09 -06:00
committed by GitHub
parent 095bad6568
commit 0979bbcc3f
11 changed files with 255 additions and 109 deletions

View File

@@ -101,7 +101,6 @@ public:
}
RpcResponseFuture exec(tr_quark method, tr_variant* args);
RpcResponseFuture exec(std::string_view method, tr_variant* args);
using Tag = RpcQueue::Tag;
Tag torrentSet(torrent_ids_t const& torrent_ids, tr_quark const key, bool val);
@@ -194,7 +193,7 @@ private:
Tag torrentSetImpl(tr_variant* args);
void sessionSet(tr_quark const key, QVariant const& value);
void pumpRequests();
void sendTorrentRequest(std::string_view request, torrent_ids_t const& torrent_ids);
void sendTorrentRequest(tr_quark method, torrent_ids_t const& torrent_ids);
void refreshTorrents(torrent_ids_t const& ids, TorrentProperties props);
std::set<std::string_view> const& getKeyNames(TorrentProperties props);