Commit cecf9ac2 authored by con's avatar con

Move find flags from IFindSupport to more accessible place.

For later use in IFindFilter.
parent 081743a0
......@@ -72,9 +72,9 @@ public:
~BinEditorFind() {}
bool supportsReplace() const { return false; }
IFindSupport::FindFlags supportedFindFlags() const
Find::FindFlags supportedFindFlags() const
{
return IFindSupport::FindBackward | IFindSupport::FindCaseSensitively;
return Find::FindBackward | Find::FindCaseSensitively;
}
void resetIncrementalSearch()
......@@ -87,16 +87,16 @@ public:
QString completedFindString() const { return QString(); }
int find(const QByteArray &pattern, int pos, Find::IFindSupport::FindFlags findFlags) {
int find(const QByteArray &pattern, int pos, Find::FindFlags findFlags) {
if (pattern.isEmpty()) {
m_editor->setCursorPosition(pos);
return pos;
}
return m_editor->find(pattern, pos, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags));
return m_editor->find(pattern, pos, Find::textDocumentFlagsForFindFlags(findFlags));
}
Result findIncremental(const QString &txt, Find::IFindSupport::FindFlags findFlags) {
Result findIncremental(const QString &txt, Find::FindFlags findFlags) {
QByteArray pattern = txt.toLatin1();
if (pattern != m_lastPattern)
resetIncrementalSearch(); // Because we don't search for nibbles.
......@@ -109,13 +109,13 @@ public:
Result result;
if (found >= 0) {
result = Found;
m_editor->highlightSearchResults(pattern, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags));
m_editor->highlightSearchResults(pattern, Find::textDocumentFlagsForFindFlags(findFlags));
m_contPos = -1;
} else {
if (found == -2) {
result = NotYetFound;
m_contPos +=
findFlags & Find::IFindSupport::FindBackward
findFlags & Find::FindBackward
? -BinEditor::SearchStride : BinEditor::SearchStride;
} else {
result = NotFound;
......@@ -126,12 +126,12 @@ public:
return result;
}
Result findStep(const QString &txt, Find::IFindSupport::FindFlags findFlags) {
Result findStep(const QString &txt, Find::FindFlags findFlags) {
QByteArray pattern = txt.toLatin1();
bool wasReset = (m_incrementalStartPos < 0);
if (m_contPos == -1) {
m_contPos = m_editor->cursorPosition();
if (findFlags & Find::IFindSupport::FindBackward)
if (findFlags & Find::FindBackward)
m_contPos = m_editor->selectionStart()-1;
}
int found = find(pattern, m_contPos, findFlags);
......@@ -141,10 +141,10 @@ public:
m_incrementalStartPos = found;
m_contPos = -1;
if (wasReset)
m_editor->highlightSearchResults(pattern, Find::IFindSupport::textDocumentFlagsForFindFlags(findFlags));
m_editor->highlightSearchResults(pattern, Find::textDocumentFlagsForFindFlags(findFlags));
} else if (found == -2) {
result = NotYetFound;
m_contPos += findFlags & Find::IFindSupport::FindBackward
m_contPos += findFlags & Find::FindBackward
? -BinEditor::SearchStride : BinEditor::SearchStride;
} else {
result = NotFound;
......@@ -155,11 +155,11 @@ public:
}
void replace(const QString &, const QString &,
Find::IFindSupport::FindFlags) { }
Find::FindFlags) { }
bool replaceStep(const QString &, const QString &,
Find::IFindSupport::FindFlags) { return false;}
Find::FindFlags) { return false;}
int replaceAll(const QString &, const QString &,
Find::IFindSupport::FindFlags) { return 0; }
Find::FindFlags) { return 0; }
private:
BinEditor *m_editor;
......
......@@ -81,10 +81,10 @@ bool BaseTextFind::supportsReplace() const
return !isReadOnly();
}
IFindSupport::FindFlags BaseTextFind::supportedFindFlags() const
Find::FindFlags BaseTextFind::supportedFindFlags() const
{
return IFindSupport::FindBackward | IFindSupport::FindCaseSensitively
| IFindSupport::FindRegularExpression | IFindSupport::FindWholeWords;
return Find::FindBackward | Find::FindCaseSensitively
| Find::FindRegularExpression | Find::FindWholeWords;
}
void BaseTextFind::resetIncrementalSearch()
......@@ -131,7 +131,7 @@ QString BaseTextFind::completedFindString() const
return cursor.selectedText();
}
IFindSupport::Result BaseTextFind::findIncremental(const QString &txt, IFindSupport::FindFlags findFlags)
IFindSupport::Result BaseTextFind::findIncremental(const QString &txt, Find::FindFlags findFlags)
{
QTextCursor cursor = textCursor();
if (m_incrementalStartPos < 0)
......@@ -145,7 +145,7 @@ IFindSupport::Result BaseTextFind::findIncremental(const QString &txt, IFindSupp
return found ? Found : NotFound;
}
IFindSupport::Result BaseTextFind::findStep(const QString &txt, IFindSupport::FindFlags findFlags)
IFindSupport::Result BaseTextFind::findStep(const QString &txt, Find::FindFlags findFlags)
{
bool found = find(txt, findFlags, textCursor());
if (found)
......@@ -154,40 +154,40 @@ IFindSupport::Result BaseTextFind::findStep(const QString &txt, IFindSupport::Fi
}
void BaseTextFind::replace(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags)
Find::FindFlags findFlags)
{
QTextCursor cursor = replaceInternal(before, after, findFlags);
setTextCursor(cursor);
}
QTextCursor BaseTextFind::replaceInternal(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags)
Find::FindFlags findFlags)
{
QTextCursor cursor = textCursor();
bool usesRegExp = (findFlags & IFindSupport::FindRegularExpression);
bool usesRegExp = (findFlags & Find::FindRegularExpression);
QRegExp regexp(before,
(findFlags & IFindSupport::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive,
(findFlags & Find::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive,
usesRegExp ? QRegExp::RegExp : QRegExp::FixedString);
if (regexp.exactMatch(cursor.selectedText())) {
QString realAfter = usesRegExp ? Utils::expandRegExpReplacement(after, regexp.capturedTexts()) : after;
int start = cursor.selectionStart();
cursor.insertText(realAfter);
if ((findFlags&IFindSupport::FindBackward) != 0)
if ((findFlags&Find::FindBackward) != 0)
cursor.setPosition(start);
}
return cursor;
}
bool BaseTextFind::replaceStep(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags)
Find::FindFlags findFlags)
{
QTextCursor cursor = replaceInternal(before, after, findFlags);
return find(before, findFlags, cursor);
}
int BaseTextFind::replaceAll(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags)
Find::FindFlags findFlags)
{
QTextCursor editCursor = textCursor();
if (!m_findScopeStart.isNull())
......@@ -196,11 +196,11 @@ int BaseTextFind::replaceAll(const QString &before, const QString &after,
editCursor.movePosition(QTextCursor::Start);
editCursor.beginEditBlock();
int count = 0;
bool usesRegExp = (findFlags & IFindSupport::FindRegularExpression);
bool usesRegExp = (findFlags & Find::FindRegularExpression);
QRegExp regexp(before);
regexp.setPatternSyntax(usesRegExp ? QRegExp::RegExp : QRegExp::FixedString);
regexp.setCaseSensitivity((findFlags & IFindSupport::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive);
QTextCursor found = findOne(regexp, editCursor, IFindSupport::textDocumentFlagsForFindFlags(findFlags));
regexp.setCaseSensitivity((findFlags & Find::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive);
QTextCursor found = findOne(regexp, editCursor, Find::textDocumentFlagsForFindFlags(findFlags));
while (!found.isNull() && found.selectionStart() < found.selectionEnd()
&& inScope(found.selectionStart(), found.selectionEnd())) {
++count;
......@@ -209,14 +209,14 @@ int BaseTextFind::replaceAll(const QString &before, const QString &after,
regexp.exactMatch(found.selectedText());
QString realAfter = usesRegExp ? Utils::expandRegExpReplacement(after, regexp.capturedTexts()) : after;
editCursor.insertText(realAfter);
found = findOne(regexp, editCursor, IFindSupport::textDocumentFlagsForFindFlags(findFlags));
found = findOne(regexp, editCursor, Find::textDocumentFlagsForFindFlags(findFlags));
}
editCursor.endEditBlock();
return count;
}
bool BaseTextFind::find(const QString &txt,
IFindSupport::FindFlags findFlags,
Find::FindFlags findFlags,
QTextCursor start)
{
if (txt.isEmpty()) {
......@@ -224,19 +224,19 @@ bool BaseTextFind::find(const QString &txt,
return true;
}
QRegExp regexp(txt);
regexp.setPatternSyntax((findFlags&IFindSupport::FindRegularExpression) ? QRegExp::RegExp : QRegExp::FixedString);
regexp.setCaseSensitivity((findFlags&IFindSupport::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive);
QTextCursor found = findOne(regexp, start, IFindSupport::textDocumentFlagsForFindFlags(findFlags));
regexp.setPatternSyntax((findFlags&Find::FindRegularExpression) ? QRegExp::RegExp : QRegExp::FixedString);
regexp.setCaseSensitivity((findFlags&Find::FindCaseSensitively) ? Qt::CaseSensitive : Qt::CaseInsensitive);
QTextCursor found = findOne(regexp, start, Find::textDocumentFlagsForFindFlags(findFlags));
if (!m_findScopeStart.isNull()) {
// scoped
if (found.isNull() || !inScope(found.selectionStart(), found.selectionEnd())) {
if ((findFlags&IFindSupport::FindBackward) == 0)
if ((findFlags&Find::FindBackward) == 0)
start.setPosition(m_findScopeStart.position());
else
start.setPosition(m_findScopeEnd.position());
found = findOne(regexp, start, IFindSupport::textDocumentFlagsForFindFlags(findFlags));
found = findOne(regexp, start, Find::textDocumentFlagsForFindFlags(findFlags));
if (found.isNull() || !inScope(found.selectionStart(), found.selectionEnd()))
return false;
}
......@@ -244,11 +244,11 @@ bool BaseTextFind::find(const QString &txt,
// entire document
if (found.isNull()) {
if ((findFlags&IFindSupport::FindBackward) == 0)
if ((findFlags&Find::FindBackward) == 0)
start.movePosition(QTextCursor::Start);
else
start.movePosition(QTextCursor::End);
found = findOne(regexp, start, IFindSupport::textDocumentFlagsForFindFlags(findFlags));
found = findOne(regexp, start, Find::textDocumentFlagsForFindFlags(findFlags));
if (found.isNull()) {
return false;
}
......
......@@ -52,34 +52,34 @@ public:
BaseTextFind(QTextEdit *editor);
bool supportsReplace() const;
IFindSupport::FindFlags supportedFindFlags() const;
Find::FindFlags supportedFindFlags() const;
void resetIncrementalSearch();
void clearResults();
QString currentFindString() const;
QString completedFindString() const;
Result findIncremental(const QString &txt, IFindSupport::FindFlags findFlags);
Result findStep(const QString &txt, IFindSupport::FindFlags findFlags);
Result findIncremental(const QString &txt, Find::FindFlags findFlags);
Result findStep(const QString &txt, Find::FindFlags findFlags);
void replace(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags);
Find::FindFlags findFlags);
bool replaceStep(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags);
Find::FindFlags findFlags);
int replaceAll(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags);
Find::FindFlags findFlags);
void defineFindScope();
void clearFindScope();
signals:
void highlightAll(const QString &txt, Find::IFindSupport::FindFlags findFlags);
void highlightAll(const QString &txt, Find::FindFlags findFlags);
void findScopeChanged(const QTextCursor &start, const QTextCursor &end, int verticalBlockSelection);
private:
bool find(const QString &txt,
IFindSupport::FindFlags findFlags,
Find::FindFlags findFlags,
QTextCursor start);
QTextCursor replaceInternal(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags);
Find::FindFlags findFlags);
QTextCursor textCursor() const;
void setTextCursor(const QTextCursor&);
......
......@@ -82,7 +82,7 @@ bool CurrentDocumentFind::supportsReplace() const
return m_currentFind->supportsReplace();
}
IFindSupport::FindFlags CurrentDocumentFind::supportedFindFlags() const
Find::FindFlags CurrentDocumentFind::supportedFindFlags() const
{
QTC_ASSERT(m_currentFind, return 0);
return m_currentFind->supportedFindFlags();
......@@ -100,40 +100,40 @@ QString CurrentDocumentFind::completedFindString() const
return m_currentFind->completedFindString();
}
void CurrentDocumentFind::highlightAll(const QString &txt, IFindSupport::FindFlags findFlags)
void CurrentDocumentFind::highlightAll(const QString &txt, Find::FindFlags findFlags)
{
QTC_ASSERT(m_currentFind, return);
m_currentFind->highlightAll(txt, findFlags);
}
IFindSupport::Result CurrentDocumentFind::findIncremental(const QString &txt, IFindSupport::FindFlags findFlags)
IFindSupport::Result CurrentDocumentFind::findIncremental(const QString &txt, Find::FindFlags findFlags)
{
QTC_ASSERT(m_currentFind, return IFindSupport::NotFound);
return m_currentFind->findIncremental(txt, findFlags);
}
IFindSupport::Result CurrentDocumentFind::findStep(const QString &txt, IFindSupport::FindFlags findFlags)
IFindSupport::Result CurrentDocumentFind::findStep(const QString &txt, Find::FindFlags findFlags)
{
QTC_ASSERT(m_currentFind, return IFindSupport::NotFound);
return m_currentFind->findStep(txt, findFlags);
}
void CurrentDocumentFind::replace(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags)
Find::FindFlags findFlags)
{
QTC_ASSERT(m_currentFind, return);
m_currentFind->replace(before, after, findFlags);
}
bool CurrentDocumentFind::replaceStep(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags)
Find::FindFlags findFlags)
{
QTC_ASSERT(m_currentFind, return false);
return m_currentFind->replaceStep(before, after, findFlags);
}
int CurrentDocumentFind::replaceAll(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags)
Find::FindFlags findFlags)
{
QTC_ASSERT(m_currentFind, return 0);
return m_currentFind->replaceAll(before, after, findFlags);
......
......@@ -47,21 +47,21 @@ public:
void resetIncrementalSearch();
void clearResults();
bool supportsReplace() const;
IFindSupport::FindFlags supportedFindFlags() const;
Find::FindFlags supportedFindFlags() const;
QString currentFindString() const;
QString completedFindString() const;
bool isEnabled() const;
bool candidateIsEnabled() const;
void highlightAll(const QString &txt, IFindSupport::FindFlags findFlags);
IFindSupport::Result findIncremental(const QString &txt, IFindSupport::FindFlags findFlags);
IFindSupport::Result findStep(const QString &txt, IFindSupport::FindFlags findFlags);
void highlightAll(const QString &txt, Find::FindFlags findFlags);
IFindSupport::Result findIncremental(const QString &txt, Find::FindFlags findFlags);
IFindSupport::Result findStep(const QString &txt, Find::FindFlags findFlags);
void replace(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags);
Find::FindFlags findFlags);
bool replaceStep(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags);
Find::FindFlags findFlags);
int replaceAll(const QString &before, const QString &after,
IFindSupport::FindFlags findFlags);
Find::FindFlags findFlags);
void defineFindScope();
void clearFindScope();
void acceptCandidate();
......
......@@ -361,6 +361,17 @@ QStringListModel *FindPlugin::replaceCompletionModel() const
return d->m_replaceCompletionModel;
}
QTextDocument::FindFlags textDocumentFlagsForFindFlags(FindFlags flags)
{
QTextDocument::FindFlags textDocFlags;
if (flags & Find::FindBackward)
textDocFlags |= QTextDocument::FindBackward;
if (flags & Find::FindCaseSensitively)
textDocFlags |= QTextDocument::FindCaseSensitively;
if (flags & Find::FindWholeWords)
textDocFlags |= QTextDocument::FindWholeWords;
return textDocFlags;
}
} // namespace Find
......
......@@ -383,13 +383,13 @@ void FindToolBar::invokeClearResults()
void FindToolBar::invokeFindNext()
{
setFindFlag(IFindSupport::FindBackward, false);
setFindFlag(Find::FindBackward, false);
invokeFindStep();
}
void FindToolBar::invokeFindPrevious()
{
setFindFlag(IFindSupport::FindBackward, true);
setFindFlag(Find::FindBackward, true);
invokeFindStep();
}
......@@ -406,7 +406,7 @@ QString FindToolBar::getReplaceText()
void FindToolBar::setFindText(const QString &text)
{
disconnect(m_ui.findEdit, SIGNAL(textChanged(const QString&)), this, SLOT(invokeFindIncremental()));
if (hasFindFlag(IFindSupport::FindRegularExpression))
if (hasFindFlag(Find::FindRegularExpression))
m_ui.findEdit->setText(QRegExp::escape(text));
else
m_ui.findEdit->setText(text);
......@@ -448,7 +448,7 @@ void FindToolBar::invokeFindIncremental()
void FindToolBar::invokeReplace()
{
setFindFlag(IFindSupport::FindBackward, false);
setFindFlag(Find::FindBackward, false);
if (m_currentDocumentFind->isEnabled() && m_currentDocumentFind->supportsReplace()) {
m_plugin->updateFindCompletion(getFindText());
m_plugin->updateReplaceCompletion(getReplaceText());
......@@ -458,13 +458,13 @@ void FindToolBar::invokeReplace()
void FindToolBar::invokeReplaceNext()
{
setFindFlag(IFindSupport::FindBackward, false);
setFindFlag(Find::FindBackward, false);
invokeReplaceStep();
}
void FindToolBar::invokeReplacePrevious()
{
setFindFlag(IFindSupport::FindBackward, true);
setFindFlag(Find::FindBackward, true);
invokeReplaceStep();
}
......@@ -524,10 +524,10 @@ void FindToolBar::findFlagsChanged()
void FindToolBar::updateIcons()
{
IFindSupport::FindFlags effectiveFlags = effectiveFindFlags();
bool casesensitive = effectiveFlags & IFindSupport::FindCaseSensitively;
bool wholewords = effectiveFlags & IFindSupport::FindWholeWords;
bool regexp = effectiveFlags & IFindSupport::FindRegularExpression;
Find::FindFlags effectiveFlags = effectiveFindFlags();
bool casesensitive = effectiveFlags & Find::FindCaseSensitively;
bool wholewords = effectiveFlags & Find::FindWholeWords;
bool regexp = effectiveFlags & Find::FindRegularExpression;
int width = 0;
if (casesensitive) width += 6;
if (wholewords) width += 6;
......@@ -557,33 +557,33 @@ void FindToolBar::updateIcons()
m_ui.findEdit->setButtonPixmap(Utils::FancyLineEdit::Left, pixmap);
}
IFindSupport::FindFlags FindToolBar::effectiveFindFlags()
Find::FindFlags FindToolBar::effectiveFindFlags()
{
IFindSupport::FindFlags supportedFlags;
Find::FindFlags supportedFlags;
if (m_currentDocumentFind->isEnabled())
supportedFlags = m_currentDocumentFind->supportedFindFlags();
else
supportedFlags = (IFindSupport::FindFlags)0xFFFFFF;
supportedFlags = (Find::FindFlags)0xFFFFFF;
return supportedFlags & m_findFlags;
}
void FindToolBar::updateFlagMenus()
{
bool wholeOnly = ((m_findFlags & IFindSupport::FindWholeWords));
bool sensitive = ((m_findFlags & IFindSupport::FindCaseSensitively));
bool regexp = ((m_findFlags & IFindSupport::FindRegularExpression));
bool wholeOnly = ((m_findFlags & Find::FindWholeWords));
bool sensitive = ((m_findFlags & Find::FindCaseSensitively));
bool regexp = ((m_findFlags & Find::FindRegularExpression));
if (m_wholeWordAction->isChecked() != wholeOnly)
m_wholeWordAction->setChecked(wholeOnly);
if (m_caseSensitiveAction->isChecked() != sensitive)
m_caseSensitiveAction->setChecked(sensitive);
if (m_regularExpressionAction->isChecked() != regexp)
m_regularExpressionAction->setChecked(regexp);
IFindSupport::FindFlags supportedFlags;
Find::FindFlags supportedFlags;
if (m_currentDocumentFind->isEnabled())
supportedFlags = m_currentDocumentFind->supportedFindFlags();
m_wholeWordAction->setEnabled(supportedFlags & IFindSupport::FindWholeWords);
m_caseSensitiveAction->setEnabled(supportedFlags & IFindSupport::FindCaseSensitively);
m_regularExpressionAction->setEnabled(supportedFlags & IFindSupport::FindRegularExpression);
m_wholeWordAction->setEnabled(supportedFlags & Find::FindWholeWords);
m_caseSensitiveAction->setEnabled(supportedFlags & Find::FindCaseSensitively);
m_regularExpressionAction->setEnabled(supportedFlags & Find::FindRegularExpression);
}
bool FindToolBar::setFocusToCurrentFindSupport()
......@@ -660,10 +660,10 @@ void FindToolBar::writeSettings()
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup("Find");
settings->beginGroup("FindToolBar");
settings->setValue("Backward", QVariant((m_findFlags & IFindSupport::FindBackward) != 0));
settings->setValue("CaseSensitively", QVariant((m_findFlags & IFindSupport::FindCaseSensitively) != 0));
settings->setValue("WholeWords", QVariant((m_findFlags & IFindSupport::FindWholeWords) != 0));
settings->setValue("RegularExpression", QVariant((m_findFlags & IFindSupport::FindRegularExpression) != 0));
settings->setValue("Backward", QVariant((m_findFlags & Find::FindBackward) != 0));
settings->setValue("CaseSensitively", QVariant((m_findFlags & Find::FindCaseSensitively) != 0));
settings->setValue("WholeWords", QVariant((m_findFlags & Find::FindWholeWords) != 0));
settings->setValue("RegularExpression", QVariant((m_findFlags & Find::FindRegularExpression) != 0));
settings->endGroup();
settings->endGroup();
}
......@@ -673,15 +673,15 @@ void FindToolBar::readSettings()
QSettings *settings = Core::ICore::instance()->settings();
settings->beginGroup("Find");
settings->beginGroup("FindToolBar");
IFindSupport::FindFlags flags;
Find::FindFlags flags;
if (settings->value("Backward", false).toBool())
flags |= IFindSupport::FindBackward;
flags |= Find::FindBackward;
if (settings->value("CaseSensitively", false).toBool())
flags |= IFindSupport::FindCaseSensitively;
flags |= Find::FindCaseSensitively;
if (settings->value("WholeWords", false).toBool())
flags |= IFindSupport::FindWholeWords;
flags |= Find::FindWholeWords;
if (settings->value("RegularExpression", false).toBool())
flags |= IFindSupport::FindRegularExpression;
flags |= Find::FindRegularExpression;
settings->endGroup();
settings->endGroup();
m_findFlags = flags;
......@@ -693,7 +693,7 @@ void FindToolBar::setUseFakeVim(bool on)
m_useFakeVim = on;
}
void FindToolBar::setFindFlag(IFindSupport::FindFlag flag, bool enabled)
void FindToolBar::setFindFlag(Find::FindFlag flag, bool enabled)
{
bool hasFlag = hasFindFlag(flag);
if ((hasFlag && enabled) || (!hasFlag && !enabled))
......@@ -702,31 +702,31 @@ void FindToolBar::setFindFlag(IFindSupport::FindFlag flag, bool enabled)
m_findFlags |= flag;
else
m_findFlags &= ~flag;
if (flag != IFindSupport::FindBackward)
if (flag != Find::FindBackward)
findFlagsChanged();
}
bool FindToolBar::hasFindFlag(IFindSupport::FindFlag flag)
bool FindToolBar::hasFindFlag(Find::FindFlag flag)
{
return m_findFlags & flag;
}
void FindToolBar::setCaseSensitive(bool sensitive)
{
setFindFlag(IFindSupport::FindCaseSensitively, sensitive);
setFindFlag(Find::FindCaseSensitively, sensitive);
}
void FindToolBar::setWholeWord(bool wholeOnly)
{
setFindFlag(IFindSupport::FindWholeWords, wholeOnly);
setFindFlag(Find::FindWholeWords, wholeOnly);
}
void FindToolBar::setRegularExpressions(bool regexp)
{
setFindFlag(IFindSupport::FindRegularExpression, regexp);
setFindFlag(Find::FindRegularExpression, regexp);
}
void FindToolBar::setBackward(bool backward)
{
setFindFlag(IFindSupport::FindBackward, backward);
setFindFlag(Find::FindBackward, backward);
}
......@@ -99,9 +99,9 @@ private:
void installEventFilters();
void invokeClearResults();
bool setFocusToCurrentFindSupport();
void setFindFlag(IFindSupport::FindFlag flag, bool enabled);
bool hasFindFlag(IFindSupport::FindFlag flag);
IFindSupport::FindFlags effectiveFindFlags();
void setFindFlag(Find::FindFlag flag, bool enabled);
bool hasFindFlag(Find::FindFlag flag);
Find::FindFlags effectiveFindFlags();
Core::FindToolBarPlaceHolder *findToolBarPlaceHolder() const;