summaryrefslogtreecommitdiff
path: root/src/plugins/beautifier/clangformat
diff options
context:
space:
mode:
authorLorenz Haas <lykurg@gmail.com>2015-06-21 19:12:02 +0200
committerDavid Schulz <david.schulz@theqtcompany.com>2015-06-23 06:21:00 +0000
commite7789de28c97b437f6c808751812d05e05886a75 (patch)
tree2a2f02aa3d8428855092aeb00e43a66d4c42709f /src/plugins/beautifier/clangformat
parentf06482ca7f36d18f433aa9509521ee57dbb2b471 (diff)
downloadqt-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.cpp5
-rw-r--r--src/plugins/beautifier/clangformat/clangformatoptionspage.cpp2
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());