diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2018-07-02 15:11:22 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2018-07-11 10:21:20 +0000 |
commit | ba70df8be7481a0b9fee466238f78ca53a517c9a (patch) | |
tree | fed8853627c0a599af94a4bcc981049de753b2bb /src/plugins/cmakeprojectmanager | |
parent | 7478c4aef1aa29ed7fb94e5b749b73d11ba00d2a (diff) | |
download | qt-creator-ba70df8be7481a0b9fee466238f78ca53a517c9a.tar.gz |
CMakeTool: Fix reading from SDKtool file
Change-Id: Ie1efbfe579c8d41ffd0795deaa3ee3759938862b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp index 71f8c58054..2f2d40b91d 100644 --- a/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketoolsettingsaccessor.cpp @@ -125,14 +125,12 @@ mergeTools(std::vector<std::unique_ptr<CMakeTool>> &sdkTools, std::vector<std::unique_ptr<CMakeTool>> &userTools, std::vector<std::unique_ptr<CMakeTool>> &autoDetectedTools) { - std::vector<std::unique_ptr<CMakeTool>> result; + std::vector<std::unique_ptr<CMakeTool>> result = std::move(sdkTools); while (userTools.size() > 0) { std::unique_ptr<CMakeTool> userTool = std::move(userTools[0]); userTools.erase(std::begin(userTools)); - if (auto sdkTool = Utils::take(sdkTools, Utils::equal(&CMakeTool::id, userTool->id()))) { - result.emplace_back(std::move(sdkTool.value())); - } else { + if (!Utils::contains(result, Utils::equal(&CMakeTool::id, userTool->id()))) { if (userTool->isAutoDetected() && !Utils::contains(autoDetectedTools, Utils::equal(&CMakeTool::cmakeExecutable, userTool->cmakeExecutable()))) { |