forked from qt-creator/qt-creator
CppTools: Allow prefering getter names with "get" prefix
We default to "foo()" for e.g. a member variable "m_foo", but other coding styles require "getFoo()". Task-number: QTCREATORBUG-16452 Change-Id: I9ccfdf88e4c469bc1c06fde855ad754faf2bd238 Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
@@ -321,6 +321,8 @@ CppCodeStylePreferencesWidget::CppCodeStylePreferencesWidget(QWidget *parent)
|
||||
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
|
||||
connect(m_ui->bindStarToRightSpecifier, &QCheckBox::toggled,
|
||||
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
|
||||
connect(m_ui->preferGetterNamesWithoutGet, &QCheckBox::toggled,
|
||||
this, &CppCodeStylePreferencesWidget::slotCodeStyleSettingsChanged);
|
||||
|
||||
m_ui->categoryTab->setCurrentIndex(0);
|
||||
|
||||
@@ -380,6 +382,7 @@ CppCodeStyleSettings CppCodeStylePreferencesWidget::cppCodeStyleSettings() const
|
||||
set.bindStarToRightSpecifier = m_ui->bindStarToRightSpecifier->isChecked();
|
||||
set.extraPaddingForConditionsIfConfusingAlign = m_ui->extraPaddingConditions->isChecked();
|
||||
set.alignAssignments = m_ui->alignAssignments->isChecked();
|
||||
set.preferGetterNameWithoutGetPrefix = m_ui->preferGetterNamesWithoutGet->isChecked();
|
||||
|
||||
return set;
|
||||
}
|
||||
@@ -413,6 +416,7 @@ void CppCodeStylePreferencesWidget::setCodeStyleSettings(const CppCodeStyleSetti
|
||||
m_ui->bindStarToRightSpecifier->setChecked(s.bindStarToRightSpecifier);
|
||||
m_ui->extraPaddingConditions->setChecked(s.extraPaddingForConditionsIfConfusingAlign);
|
||||
m_ui->alignAssignments->setChecked(s.alignAssignments);
|
||||
m_ui->preferGetterNamesWithoutGet->setChecked(s.preferGetterNameWithoutGetPrefix);
|
||||
m_blockUpdates = wasBlocked;
|
||||
if (preview)
|
||||
updatePreview();
|
||||
|
||||
Reference in New Issue
Block a user