Further refactor ServerConfiguration::URL()


- Rename the function to url() and update its documentation.
- Make it const, because it does not modify the class members.
- Return a QUrl instead of a QString to avoid conversions at the
  caller side.
- Refactor the code to avoid unnecessary QUrl->QString->QUrl
  conversions if there's nothing to substitute.
- Do not use QRegularExpression when substituting the variable
  name with its value. Use a QString::replace() overload that
  takes two strings instead. This allows to avoid an overhead
  of creating a regular expression.
- Drop std::optional from the return value. Always do the
  substitution and return the resulting URL, even if the variable
  value does not belong to the enum. Leave it up to the server to
  decide how to handle such requests.

Task-number: QTBUG-141948
Change-Id: I1c291d38acb3d86293978dbe421f07618ea7b7a5
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commitec9dda617af5505a4905d92a31461d06dd556975
parentd529a638f34986e4f15e51887ab661e5708b3be9
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeWed, 26 Nov 2025 18:27:24 +0100