Rework BaseApi::setDefaultServerValue() method
* Rename it to setServerVariable().
Use "variable" in the name because it sets the value of a server
variable, not the server. Drop "value", because it is unnecessary
and just makes the name longer.
* Reorder the arguments. Put operation as a first argument, because
this is a primary parameter to identify the server. The serverIndex
goes next.
* Use qsizetype for serverIndex. It is an index in a QList, so should
use qsizetype, not int.
* Rework the implementation:
- do not use QMap::operator[], because we already have a non-const
iterator;
- add a check for a negative index.
* Update the function signature in the README file.
Adapt the unit-tests to these changes, and add a new unit-test that
covers all error cases.
Found in API review.
Task-number: QTBUG-142269
Pick-to: 6.11
Change-Id: Iae0e8aa220000eba4ec33ad52d4aa989f56cc039
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>