diff --git a/.clang-tidy b/.clang-tidy index a3426563812b0145ab655b25c2b42431e4fb91da..040d0ee0bbdd23b7447cc00aa06b572b760c7139 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 bdb2cc71ae9199fdc95856053736fd513591064f..9826ff016e637e87c040a749169845aae19dcda8 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."); }