summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppcodestylesettings.cpp
diff options
context:
space:
mode:
authorNikolai Kosjar <nikolai.kosjar@qt.io>2019-02-07 10:09:21 +0100
committerNikolai Kosjar <nikolai.kosjar@qt.io>2019-02-08 08:43:32 +0000
commit12f4b1ee865a7c616dfe4f2049e731d2bd4d4dcb (patch)
tree49d447335ec8bacb705a7155ae5b94ec9274f8c3 /src/plugins/cpptools/cppcodestylesettings.cpp
parent69281bcdcf20d98ffada890573c5e2df5d832fa1 (diff)
downloadqt-creator-12f4b1ee865a7c616dfe4f2049e731d2bd4d4dcb.tar.gz
CppTools: Modernize
Change-Id: I78af9cd4ccddfa4ed744dce96b772ae5644c89d2 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src/plugins/cpptools/cppcodestylesettings.cpp')
-rw-r--r--src/plugins/cpptools/cppcodestylesettings.cpp34
1 files changed, 5 insertions, 29 deletions
diff --git a/src/plugins/cpptools/cppcodestylesettings.cpp b/src/plugins/cpptools/cppcodestylesettings.cpp
index 745ea3ab62..5b07d84334 100644
--- a/src/plugins/cpptools/cppcodestylesettings.cpp
+++ b/src/plugins/cpptools/cppcodestylesettings.cpp
@@ -67,30 +67,7 @@ using namespace CppTools;
// ------------------ CppCodeStyleSettingsWidget
-CppCodeStyleSettings::CppCodeStyleSettings() :
- indentBlockBraces(false)
- , indentBlockBody(true)
- , indentClassBraces(false)
- , indentEnumBraces(false)
- , indentNamespaceBraces(false)
- , indentNamespaceBody(false)
- , indentAccessSpecifiers(false)
- , indentDeclarationsRelativeToAccessSpecifiers(true)
- , indentFunctionBody(true)
- , indentFunctionBraces(false)
- , indentSwitchLabels(false)
- , indentStatementsRelativeToSwitchLabels(true)
- , indentBlocksRelativeToSwitchLabels(false)
- , indentControlFlowRelativeToSwitchLabels(true)
- , bindStarToIdentifier(true)
- , bindStarToTypeName(false)
- , bindStarToLeftSpecifier(false)
- , bindStarToRightSpecifier(false)
- , extraPaddingForConditionsIfConfusingAlign(true)
- , alignAssignments(false)
- , preferGetterNameWithoutGetPrefix(true)
-{
-}
+CppCodeStyleSettings::CppCodeStyleSettings() = default;
void CppCodeStyleSettings::toSettings(const QString &category, QSettings *s) const
{
@@ -203,21 +180,20 @@ bool CppCodeStyleSettings::equals(const CppCodeStyleSettings &rhs) const
Utils::optional<CppCodeStyleSettings> CppCodeStyleSettings::currentProjectCodeStyle()
{
ProjectExplorer::Project *project = ProjectExplorer::ProjectTree::currentProject();
- using OptSettings = Utils::optional<CppCodeStyleSettings>;
if (!project)
- return OptSettings();
+ return {};
ProjectExplorer::EditorConfiguration *editorConfiguration = project->editorConfiguration();
- QTC_ASSERT(editorConfiguration, return OptSettings());
+ QTC_ASSERT(editorConfiguration, return {});
TextEditor::ICodeStylePreferences *codeStylePreferences
= editorConfiguration->codeStyle(Constants::CPP_SETTINGS_ID);
- QTC_ASSERT(codeStylePreferences, return OptSettings());
+ QTC_ASSERT(codeStylePreferences, return {});
auto cppCodeStylePreferences =
dynamic_cast<const CppCodeStylePreferences *>(codeStylePreferences);
if (!cppCodeStylePreferences)
- return OptSettings();
+ return {};
return cppCodeStylePreferences->currentCodeStyleSettings();
}