forked from qt-creator/qt-creator
CppTools: Allow to check whether project code style exists
The calling code can anyways fallback to the global style without extra help if no project style exists. It is useful when you want to get the project style if it exists and understand at the same time that it is not a global one. Change-Id: I265de3f436f90623385427fc8a1abad09c8c3577 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -2988,7 +2988,10 @@ public:
|
||||
m_baseName = QLatin1String("value");
|
||||
|
||||
// Getter Name
|
||||
const CppCodeStyleSettings settings = CppCodeStyleSettings::currentProjectCodeStyle();
|
||||
const Utils::optional<CppCodeStyleSettings> codeStyleSettings
|
||||
= CppCodeStyleSettings::currentProjectCodeStyle();
|
||||
const CppCodeStyleSettings settings
|
||||
= codeStyleSettings.value_or(CppCodeStyleSettings::currentGlobalCodeStyle());
|
||||
const bool hasValidBaseName = m_baseName != m_variableString;
|
||||
const bool getPrefixIsAlreadyUsed = hasClassMemberWithGetPrefix(m_classSpecifier->symbol);
|
||||
if (settings.preferGetterNameWithoutGetPrefix && hasValidBaseName && !getPrefixIsAlreadyUsed) {
|
||||
|
||||
Reference in New Issue
Block a user