diff options
author | Lorenz Haas <lykurg@gmail.com> | 2015-06-21 19:12:02 +0200 |
---|---|---|
committer | David Schulz <david.schulz@theqtcompany.com> | 2015-06-23 06:21:00 +0000 |
commit | e7789de28c97b437f6c808751812d05e05886a75 (patch) | |
tree | 2a2f02aa3d8428855092aeb00e43a66d4c42709f /src/plugins/beautifier/clangformat | |
parent | f06482ca7f36d18f433aa9509521ee57dbb2b471 (diff) | |
download | qt-creator-e7789de28c97b437f6c808751812d05e05886a75.tar.gz |
Beautifier: Add const wherever applicable
Change-Id: Iba3e5793bfd0e4057074e2b04e6353ba09aa4a5f
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
Diffstat (limited to 'src/plugins/beautifier/clangformat')
-rw-r--r-- | src/plugins/beautifier/clangformat/clangformat.cpp | 5 | ||||
-rw-r--r-- | src/plugins/beautifier/clangformat/clangformatoptionspage.cpp | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/beautifier/clangformat/clangformat.cpp b/src/plugins/beautifier/clangformat/clangformat.cpp index e277c86a31..79eee4a135 100644 --- a/src/plugins/beautifier/clangformat/clangformat.cpp +++ b/src/plugins/beautifier/clangformat/clangformat.cpp @@ -112,11 +112,12 @@ void ClangFormat::formatFile() void ClangFormat::formatSelectedText() { - TextEditor::TextEditorWidget *widget = TextEditor::TextEditorWidget::currentTextEditorWidget(); + const TextEditor::TextEditorWidget *widget + = TextEditor::TextEditorWidget::currentTextEditorWidget(); if (!widget) return; - QTextCursor tc = widget->textCursor(); + const QTextCursor tc = widget->textCursor(); if (tc.hasSelection()) { const int offset = tc.selectionStart(); const int length = tc.selectionEnd() - offset; diff --git a/src/plugins/beautifier/clangformat/clangformatoptionspage.cpp b/src/plugins/beautifier/clangformat/clangformatoptionspage.cpp index f271a2ffa2..32fb362f05 100644 --- a/src/plugins/beautifier/clangformat/clangformatoptionspage.cpp +++ b/src/plugins/beautifier/clangformat/clangformatoptionspage.cpp @@ -69,7 +69,7 @@ ClangFormatOptionsPageWidget::~ClangFormatOptionsPageWidget() void ClangFormatOptionsPageWidget::restore() { ui->command->setPath(m_settings->command()); - int textIndex = ui->predefinedStyle->findText(m_settings->predefinedStyle()); + const int textIndex = ui->predefinedStyle->findText(m_settings->predefinedStyle()); if (textIndex != -1) ui->predefinedStyle->setCurrentIndex(textIndex); ui->formatEntireFileFallback->setChecked(m_settings->formatEntireFileFallback()); |