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>
commit8d36af45b0de8fdc686871a2a818f72ad0a6a28e
parent10cb3ef4aa26f08acefabf1aa2f05d0097878b8f
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeFri, 12 Dec 2025 10:09:56 +0100