From 81955e045e440dc5932181daccfb1046dd18ba6c Mon Sep 17 00:00:00 2001 From: Leandro Melo <leandro.melo@nokia.com> Date: Thu, 17 Jun 2010 15:27:28 +0200 Subject: [PATCH] Generic highlighter: Renaming a couple of methods. --- src/plugins/texteditor/generichighlighter/highlighter.cpp | 4 ++-- src/plugins/texteditor/generichighlighter/progressdata.cpp | 4 ++-- src/plugins/texteditor/generichighlighter/progressdata.h | 4 ++-- src/plugins/texteditor/generichighlighter/rule.cpp | 4 ++-- src/plugins/texteditor/generichighlighter/rule.h | 2 +- .../generichighlighter/specificrules/tst_specificrules.cpp | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/plugins/texteditor/generichighlighter/highlighter.cpp b/src/plugins/texteditor/generichighlighter/highlighter.cpp index 3e28bb93c56..443b2d23387 100644 --- a/src/plugins/texteditor/generichighlighter/highlighter.cpp +++ b/src/plugins/texteditor/generichighlighter/highlighter.cpp @@ -202,7 +202,7 @@ void Highlighter::iterateThroughRules(const QString &text, if (rule->matchSucceed(text, length, progress)) { atLeastOneMatch = true; - if (progress->willContinueLine()) { + if (progress->isWillContinueLine()) { createWillContinueBlock(); progress->setWillContinueLine(false); } else { @@ -247,7 +247,7 @@ void Highlighter::iterateThroughRules(const QString &text, } else { applyFormat(progress->offset(), 1, m_currentContext->itemData(), m_currentContext->definition()); - if (progress->onlySpacesSoFar() && !text.at(progress->offset()).isSpace()) + if (progress->isOnlySpacesSoFar() && !text.at(progress->offset()).isSpace()) progress->setOnlySpacesSoFar(false); progress->incrementOffset(); } diff --git a/src/plugins/texteditor/generichighlighter/progressdata.cpp b/src/plugins/texteditor/generichighlighter/progressdata.cpp index 12c76079d84..3cc3ebcc2b2 100644 --- a/src/plugins/texteditor/generichighlighter/progressdata.cpp +++ b/src/plugins/texteditor/generichighlighter/progressdata.cpp @@ -66,13 +66,13 @@ void ProgressData::restoreOffset() void ProgressData::setOnlySpacesSoFar(const bool onlySpaces) { m_onlySpacesSoFar = onlySpaces; } -bool ProgressData::onlySpacesSoFar() const +bool ProgressData::isOnlySpacesSoFar() const { return m_onlySpacesSoFar; } void ProgressData::setWillContinueLine(const bool willContinue) { m_willContinueLine = willContinue; } -bool ProgressData::willContinueLine() const +bool ProgressData::isWillContinueLine() const { return m_willContinueLine; } void ProgressData::setCaptures(const QStringList &captures) diff --git a/src/plugins/texteditor/generichighlighter/progressdata.h b/src/plugins/texteditor/generichighlighter/progressdata.h index a621c15dc75..93e1884862e 100644 --- a/src/plugins/texteditor/generichighlighter/progressdata.h +++ b/src/plugins/texteditor/generichighlighter/progressdata.h @@ -50,10 +50,10 @@ public: void restoreOffset(); void setOnlySpacesSoFar(const bool onlySpaces); - bool onlySpacesSoFar() const; + bool isOnlySpacesSoFar() const; void setWillContinueLine(const bool willContinue); - bool willContinueLine() const; + bool isWillContinueLine() const; void setCaptures(const QStringList &captures); const QStringList &captures() const; diff --git a/src/plugins/texteditor/generichighlighter/rule.cpp b/src/plugins/texteditor/generichighlighter/rule.cpp index 3ad611938e4..b21d081f8fb 100644 --- a/src/plugins/texteditor/generichighlighter/rule.cpp +++ b/src/plugins/texteditor/generichighlighter/rule.cpp @@ -162,7 +162,7 @@ bool Rule::charPredicateMatchSucceed(const QString &text, bool Rule::matchSucceed(const QString &text, const int length, ProgressData *progress) const { - if (m_firstNonSpace && !progress->onlySpacesSoFar()) + if (m_firstNonSpace && !progress->isOnlySpacesSoFar()) return false; if (m_column != -1 && m_column != progress->offset()) @@ -170,7 +170,7 @@ bool Rule::matchSucceed(const QString &text, const int length, ProgressData *pro int original = progress->offset(); if (doMatchSucceed(text, length, progress)) { - if (progress->onlySpacesSoFar() && !m_lookAhead && m_consumesNonSpace) + if (progress->isOnlySpacesSoFar() && !m_lookAhead && m_consumesNonSpace) progress->setOnlySpacesSoFar(false); if (m_lookAhead) diff --git a/src/plugins/texteditor/generichighlighter/rule.h b/src/plugins/texteditor/generichighlighter/rule.h index a53b2f8e5c4..0ffd57d2e2d 100644 --- a/src/plugins/texteditor/generichighlighter/rule.h +++ b/src/plugins/texteditor/generichighlighter/rule.h @@ -123,7 +123,7 @@ protected: static const QLatin1Char kN; static const QLatin1Char kR; static const QLatin1Char kT; - static const QLatin1Char kV; + static const QLatin1Char kV; private: virtual bool doMatchSucceed(const QString &text, diff --git a/tests/auto/generichighlighter/specificrules/tst_specificrules.cpp b/tests/auto/generichighlighter/specificrules/tst_specificrules.cpp index 6e482f38b99..c06b61fbaf5 100644 --- a/tests/auto/generichighlighter/specificrules/tst_specificrules.cpp +++ b/tests/auto/generichighlighter/specificrules/tst_specificrules.cpp @@ -149,8 +149,8 @@ void tst_SpecificRules::testMatch(const Rule &rule, ProgressData *progress) cons QTEST(rule.matchSucceed(s, s.length(), progress), "match"); QTEST(progress->offset(), "offset"); - QTEST(progress->onlySpacesSoFar(), "only spaces"); - QTEST(progress->willContinueLine(), "will continue"); + QTEST(progress->isOnlySpacesSoFar(), "only spaces"); + QTEST(progress->isWillContinueLine(), "will continue"); } void tst_SpecificRules::testDetectChar() -- GitLab