mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
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:
@@ -1481,7 +1481,7 @@ void Application::Impl::start_all_torrents()
|
||||
tr_variant request;
|
||||
|
||||
tr_variantInitDict(&request, 1);
|
||||
tr_variantDictAddStrView(&request, TR_KEY_method, "torrent-start"sv);
|
||||
tr_variantDictAddStrView(&request, TR_KEY_method, tr_quark_get_string_view(TR_KEY_torrent_start_kebab));
|
||||
tr_rpc_request_exec(session, request, {});
|
||||
}
|
||||
|
||||
@@ -1491,7 +1491,7 @@ void Application::Impl::pause_all_torrents()
|
||||
tr_variant request;
|
||||
|
||||
tr_variantInitDict(&request, 1);
|
||||
tr_variantDictAddStrView(&request, TR_KEY_method, "torrent-stop"sv);
|
||||
tr_variantDictAddStrView(&request, TR_KEY_method, tr_quark_get_string_view(TR_KEY_torrent_stop_kebab));
|
||||
tr_rpc_request_exec(session, request, {});
|
||||
}
|
||||
|
||||
@@ -1564,6 +1564,7 @@ void Application::Impl::actions_handler(Glib::ustring const& action_name)
|
||||
}
|
||||
}
|
||||
else if (
|
||||
// TODO: migrate from _kebab
|
||||
action_name == "torrent-start" || action_name == "torrent-start-now" || action_name == "torrent-stop" ||
|
||||
action_name == "torrent-reannounce" || action_name == "torrent-verify" || action_name == "queue-move-top" ||
|
||||
action_name == "queue-move-up" || action_name == "queue-move-down" || action_name == "queue-move-bottom")
|
||||
|
||||
Reference in New Issue
Block a user