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>