This patch fixes wrong CMake arguments during adding new build directory by user.
Reproducible - always. Steps to reproduce:
- Open some CMake-based project and go to it's configuration.
- Open CMake settings.
- Press "Show Advanced" button.
- Press button to add new build directory.
- Change some parameters, for example build type to MinSizeRel.
- Press "OK".
- Selected parameters will be "dropped" and replaced by it's default values. For example, build type will have Release value.
As a result, user can't set any CMake parameters for new build directory - all new directories will be Release builds with default settings.
This caused by wrong order in the CMakePreferences::createBuildDir() method: it first adds new directory into combo box and then save parameters values to config. But adding directory to the combo box leads to calling CMakePreferences::buildDirChanged() method, which will try to read not yet populated config.