Core: Apply 'static' pattern to Core::FindPlugin

Also, rename it to Core::Find. It hasn't been a plugin for a while.

Change-Id: I845885ccf18bdc1440258d523b033758d5583881
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
hjk
2016-03-11 19:12:07 +01:00
parent 2ffd95f66a
commit bcf7a11c24
15 changed files with 172 additions and 212 deletions

View File

@@ -63,9 +63,8 @@ static const int FINDBUTTON_SPACER_WIDTH = 20;
namespace Core {
namespace Internal {
FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumentFind)
: m_plugin(plugin),
m_currentDocumentFind(currentDocumentFind),
FindToolBar::FindToolBar(CurrentDocumentFind *currentDocumentFind)
: m_currentDocumentFind(currentDocumentFind),
m_findCompleter(new QCompleter(this)),
m_replaceCompleter(new QCompleter(this)),
m_enterFindStringAction(0),
@@ -98,8 +97,8 @@ FindToolBar::FindToolBar(FindPlugin *plugin, CurrentDocumentFind *currentDocumen
connect(m_ui.close, &QToolButton::clicked,
this, &FindToolBar::hideAndResetFocus);
m_findCompleter->setModel(m_plugin->findCompletionModel());
m_replaceCompleter->setModel(m_plugin->replaceCompletionModel());
m_findCompleter->setModel(Find::findCompletionModel());
m_replaceCompleter->setModel(Find::replaceCompletionModel());
m_ui.findEdit->setSpecialCompleter(m_findCompleter);
m_ui.replaceEdit->setSpecialCompleter(m_replaceCompleter);
@@ -536,7 +535,7 @@ void FindToolBar::invokeFindStep()
m_findStepTimer.stop();
m_findIncrementalTimer.stop();
if (m_currentDocumentFind->isEnabled()) {
m_plugin->updateFindCompletion(getFindText());
Find::updateFindCompletion(getFindText());
IFindSupport::Result result =
m_currentDocumentFind->findStep(getFindText(), effectiveFindFlags());
indicateSearchState(result);
@@ -565,8 +564,8 @@ void FindToolBar::invokeReplace()
{
setFindFlag(FindBackward, false);
if (m_currentDocumentFind->isEnabled() && m_currentDocumentFind->supportsReplace()) {
m_plugin->updateFindCompletion(getFindText());
m_plugin->updateReplaceCompletion(getReplaceText());
Find::updateFindCompletion(getFindText());
Find::updateReplaceCompletion(getReplaceText());
m_currentDocumentFind->replace(getFindText(), getReplaceText(), effectiveFindFlags());
}
}
@@ -604,16 +603,16 @@ void FindToolBar::invokeGlobalReplacePrevious()
void FindToolBar::invokeReplaceStep()
{
if (m_currentDocumentFind->isEnabled() && m_currentDocumentFind->supportsReplace()) {
m_plugin->updateFindCompletion(getFindText());
m_plugin->updateReplaceCompletion(getReplaceText());
Find::updateFindCompletion(getFindText());
Find::updateReplaceCompletion(getReplaceText());
m_currentDocumentFind->replaceStep(getFindText(), getReplaceText(), effectiveFindFlags());
}
}
void FindToolBar::invokeReplaceAll()
{
m_plugin->updateFindCompletion(getFindText());
m_plugin->updateReplaceCompletion(getReplaceText());
Find::updateFindCompletion(getFindText());
Find::updateReplaceCompletion(getReplaceText());
if (m_currentDocumentFind->isEnabled() && m_currentDocumentFind->supportsReplace())
m_currentDocumentFind->replaceAll(getFindText(), getReplaceText(), effectiveFindFlags());
}