refactor: inline simple getters in qt client (#6621)

* refactor: make RpcClient::url() constexpr

* refactor: make Session::getRemoteUrl() constexpr

* refactor: make RpcQueue::setTolerateErrors() constexpr

* refactor: make RpcClient::isLocal() constexpr

* refactor: make Session::isLocal() constexpr

* refactor: make Session::isServer() constexpr

* refactor: make PathButton::label() constexpr

* chore: remove accidentally-committed makelog file
This commit is contained in:
Charles Kerr
2024-02-18 18:48:27 -06:00
committed by GitHub
parent b1b685af3f
commit a90d0fce2b
8 changed files with 28 additions and 52 deletions

View File

@@ -46,7 +46,7 @@ public:
void stop();
void restart();
QUrl const& getRemoteUrl() const
[[nodiscard]] constexpr auto const& getRemoteUrl() const noexcept
{
return rpc_.url();
}
@@ -86,10 +86,16 @@ public:
bool portTestPending(PortTestIpProtocol ip_protocol) const noexcept;
/** returns true if the transmission session is being run inside this client */
bool isServer() const;
[[nodiscard]] constexpr auto isServer() const noexcept
{
return session_ != nullptr;
}
/** returns true if isServer() is true or if the remote address is the localhost */
bool isLocal() const;
[[nodiscard]] auto isLocal() const noexcept
{
return !session_id_.isEmpty() ? is_definitely_local_session_ : rpc_.isLocal();
}
RpcResponseFuture exec(tr_quark method, tr_variant* args);
RpcResponseFuture exec(std::string_view method, tr_variant* args);