Fix bug with wrong CMake arguments during adding new build directory

Authored by antonanikin on Jan 11 2017, 4:33 AM.



This patch fixes wrong CMake arguments during adding new build directory by user.

Reproducible - always. Steps to reproduce:

  1. Open some CMake-based project and go to it's configuration.
  2. Open CMake settings.
  3. Press "Show Advanced" button.
  4. Press button to add new build directory.
  5. Change some parameters, for example build type to MinSizeRel.
  6. Press "OK".
  7. 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.

Test Plan

Tested on master branch.

Diff Detail

R32 KDevelop
No Linters Available
No Unit Test Coverage
antonanikin retitled this revision from to Fix bug with wrong CMake arguments during adding new build directory.
antonanikin updated this object.
antonanikin edited the test plan for this revision. (Show Details)
antonanikin added a reviewer: KDevelop.
antonanikin added a subscriber: kdevelop-devel.
antonanikin updated this object.Jan 11 2017, 4:36 AM
kfunk added a reviewer: apol.Jan 12 2017, 8:18 AM
apol accepted this revision.Jan 12 2017, 11:31 AM
apol edited edge metadata.
This revision is now accepted and ready to land.Jan 12 2017, 11:31 AM
kfunk accepted this revision.Jan 13 2017, 7:52 AM
kfunk added a reviewer: kfunk.
kfunk added a subscriber: kfunk.

Will push

This revision was automatically updated to reflect the committed changes.