From 82a46e6076feccce6f66311b09b24f76f21f1758 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Sat, 3 Oct 2020 20:05:51 +0200 Subject: [PATCH] ctd (resolve some, deactivate some other warnings) --- .clang-tidy | 1 + GUI/coregui/Models/JobModelFunctions.cpp | 13 ++++++------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index a3426563812..040d0ee0bbd 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -19,6 +19,7 @@ Checks: '*, -cppcoreguidelines-pro-type-vararg, -fuchsia-default-arguments-calls, -fuchsia-overloaded-operator, +-fuchsia-trailing-return, -google-build-using-namespace, -google-default-arguments, -google-readability-todo, diff --git a/GUI/coregui/Models/JobModelFunctions.cpp b/GUI/coregui/Models/JobModelFunctions.cpp index bdb2cc71ae9..9826ff016e6 100644 --- a/GUI/coregui/Models/JobModelFunctions.cpp +++ b/GUI/coregui/Models/JobModelFunctions.cpp @@ -266,17 +266,16 @@ void createFitContainers(JobItem* jobItem) { SessionModel* model = jobItem->model(); - SessionItem* fitSuiteItem = jobItem->getItem(JobItem::T_FIT_SUITE); - if (fitSuiteItem != nullptr) { + SessionItem* result = jobItem->getItem(JobItem::T_FIT_SUITE); + if (result != nullptr) throw GUIHelpers::Error("JobModel::createFitContainers() -> Error. Attempt to create " "a second FitSuiteItem."); - } fitSuiteItem = model->insertNewItem("FitSuite", jobItem->index(), -1, JobItem::T_FIT_SUITE); - SessionItem* parsContainerItem = + SessionItem* result = fitSuiteItem->getItem(FitSuiteItem::T_FIT_PARAMETERS_CONTAINER); - if (parsContainerItem != nullptr) { + if (result != nullptr) { throw GUIHelpers::Error("JobModel::createFitContainers() -> Error. Attempt to create " "a second FitParameterContainer."); } @@ -285,8 +284,8 @@ void createFitContainers(JobItem* jobItem) FitSuiteItem::T_FIT_PARAMETERS_CONTAINER); // Minimizer settings - SessionItem* minimizerContainerItem = fitSuiteItem->getItem(FitSuiteItem::T_MINIMIZER); - if (minimizerContainerItem != nullptr) { + SessionItem* result = fitSuiteItem->getItem(FitSuiteItem::T_MINIMIZER); + if (result != nullptr) { throw GUIHelpers::Error("JobModel::createFitContainers() -> Error. Attempt to create " "a second MinimizerContainer."); } -- GitLab