Fix bug with wrong CMake arguments during adding new build directory

Authored by antonanikin on Jan 12 2017, 10:54 PM.

Description

Fix bug with wrong CMake arguments during adding new build directory

Summary:
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.

Reviewers: apol, KDevelop

Reviewed By: apol, KDevelop

Subscribers: kdevelop-devel

Differential Revision: https://phabricator.kde.org/D4079

Details

Committed
kfunkJan 13 2017, 7:54 AM
Reviewer
KDevelop
Differential Revision
D4079: Fix bug with wrong CMake arguments during adding new build directory
Parents
R32:11e20f915543: Clang: Don't propose to refactor function defs
Branches
Unknown
Tags
Unknown