forked from qt-creator/qt-creator
CppEditor: Let user decide whether to use "auto"
... in "Assign to Local Variable" quickfix. Fixes: QTCREATORBUG-28099 Change-Id: I3640ef3d1e069bb2cac4d78f0ae60726b131c4fe Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -1614,8 +1614,10 @@ private:
|
||||
CppRefactoringChanges refactoring(snapshot());
|
||||
CppRefactoringFilePtr currentFile = refactoring.file(filePath());
|
||||
Overview oo = CppCodeStyleSettings::currentProjectCodeStyleOverview();
|
||||
const auto settings = CppQuickFixProjectsSettings::getQuickFixSettings(
|
||||
ProjectExplorer::ProjectTree::currentProject());
|
||||
|
||||
if (currentFile->cppDocument()->languageFeatures().cxx11Enabled)
|
||||
if (currentFile->cppDocument()->languageFeatures().cxx11Enabled && settings->useAuto)
|
||||
return "auto " + oo.prettyName(simpleNameAST->name);
|
||||
|
||||
TypeOfExpression typeOfExpression;
|
||||
@@ -6764,7 +6766,9 @@ private:
|
||||
|
||||
QString deduceType() const
|
||||
{
|
||||
if (m_file->cppDocument()->languageFeatures().cxx11Enabled)
|
||||
const auto settings = CppQuickFixProjectsSettings::getQuickFixSettings(
|
||||
ProjectExplorer::ProjectTree::currentProject());
|
||||
if (m_file->cppDocument()->languageFeatures().cxx11Enabled && settings->useAuto)
|
||||
return "auto " + m_originalName;
|
||||
|
||||
TypeOfExpression typeOfExpression;
|
||||
|
||||
Reference in New Issue
Block a user