diff options
author | Roberto Raggi <roberto.raggi@nokia.com> | 2009-10-09 11:13:59 +0200 |
---|---|---|
committer | Roberto Raggi <roberto.raggi@nokia.com> | 2009-10-09 11:13:59 +0200 |
commit | f820c1c77660351ce4ce2a40829b563e061bc87e (patch) | |
tree | 38c8a9312d3422f7b04f813ba1823dff6ae75d6d /src/plugins/cpptools/cpptoolsplugin.cpp | |
parent | edcbb6a119cd92d43d235578a0cee6d6a3a5ad16 (diff) | |
download | qt-creator-f820c1c77660351ce4ce2a40829b563e061bc87e.tar.gz |
Removed CppSemanticSearch & co. Find usages of a Symbol is way more powerful.
Diffstat (limited to 'src/plugins/cpptools/cpptoolsplugin.cpp')
-rw-r--r-- | src/plugins/cpptools/cpptoolsplugin.cpp | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/src/plugins/cpptools/cpptoolsplugin.cpp b/src/plugins/cpptools/cpptoolsplugin.cpp index c3f09a98f1..3b24b91f16 100644 --- a/src/plugins/cpptools/cpptoolsplugin.cpp +++ b/src/plugins/cpptools/cpptoolsplugin.cpp @@ -37,7 +37,6 @@ #include "cppmodelmanager.h" #include "cpptoolsconstants.h" #include "cppquickopenfilter.h" -#include "cppsemanticsearch.h" #include <extensionsystem/pluginmanager.h> @@ -75,113 +74,6 @@ enum { debug = 0 }; CppToolsPlugin *CppToolsPlugin::m_instance = 0; -FindClassDeclarations::FindClassDeclarations(CppModelManager *modelManager) - : _modelManager(modelManager), - _resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>()) -{ - m_watcher.setPendingResultsLimit(1); - connect(&m_watcher, SIGNAL(resultReadyAt(int)), this, SLOT(displayResult(int))); - connect(&m_watcher, SIGNAL(finished()), this, SLOT(searchFinished())); -} - -void FindClassDeclarations::findAll(const QString &text, QTextDocument::FindFlags findFlags) -{ - Find::SearchResult *search = _resultWindow->startNewSearch(); - connect(search, SIGNAL(activated(Find::SearchResultItem)), - this, SLOT(openEditor(Find::SearchResultItem))); - - _resultWindow->popup(true); - - Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager(); - - SemanticSearchFactory::Ptr factory(new SearchClassDeclarationsFactory(text, findFlags)); - - QFuture<Utils::FileSearchResult> result = semanticSearch(_modelManager, factory); - - m_watcher.setFuture(result); - - Core::FutureProgress *progress = progressManager->addTask(result, tr("Search class"), - CppTools::Constants::TASK_INDEX, - Core::ProgressManager::CloseOnSuccess); - - connect(progress, SIGNAL(clicked()), _resultWindow, SLOT(popup())); -} - -void FindClassDeclarations::displayResult(int index) -{ - Utils::FileSearchResult result = m_watcher.future().resultAt(index); - _resultWindow->addResult(result.fileName, - result.lineNumber, - result.matchingLine, - result.matchStart, - result.matchLength); -} - -void FindClassDeclarations::searchFinished() -{ - emit changed(); -} - -void FindClassDeclarations::openEditor(const Find::SearchResultItem &item) -{ - TextEditor::BaseTextEditor::openEditorAt(item.fileName, item.lineNumber, item.searchTermStart); -} - -////// -FindFunctionCalls::FindFunctionCalls(CppModelManager *modelManager) - : _modelManager(modelManager), - _resultWindow(ExtensionSystem::PluginManager::instance()->getObject<Find::SearchResultWindow>()) -{ - m_watcher.setPendingResultsLimit(1); - connect(&m_watcher, SIGNAL(resultReadyAt(int)), this, SLOT(displayResult(int))); - connect(&m_watcher, SIGNAL(finished()), this, SLOT(searchFinished())); -} - -void FindFunctionCalls::findAll(const QString &text, QTextDocument::FindFlags findFlags) -{ - Find::SearchResult *search = _resultWindow->startNewSearch(); - connect(search, SIGNAL(activated(Find::SearchResultItem)), - this, SLOT(openEditor(Find::SearchResultItem))); - - _resultWindow->popup(true); - - Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager(); - - SemanticSearchFactory::Ptr factory(new SearchFunctionCallFactory(text, findFlags)); - - QFuture<Utils::FileSearchResult> result = semanticSearch(_modelManager, factory); - - m_watcher.setFuture(result); - - Core::FutureProgress *progress = progressManager->addTask(result, tr("Search functions"), - CppTools::Constants::TASK_INDEX, - Core::ProgressManager::CloseOnSuccess); - - connect(progress, SIGNAL(clicked()), _resultWindow, SLOT(popup())); -} - -void FindFunctionCalls::displayResult(int index) -{ - Utils::FileSearchResult result = m_watcher.future().resultAt(index); - _resultWindow->addResult(result.fileName, - result.lineNumber, - result.matchingLine, - result.matchStart, - result.matchLength); -} - -void FindFunctionCalls::searchFinished() -{ - emit changed(); -} - -void FindFunctionCalls::openEditor(const Find::SearchResultItem &item) -{ - TextEditor::BaseTextEditor::openEditorAt(item.fileName, item.lineNumber, item.searchTermStart); -} - - - CppToolsPlugin::CppToolsPlugin() : m_context(-1), m_modelManager(0), @@ -221,9 +113,6 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error) addAutoReleasedObject(new CompletionSettingsPage(m_completion)); addAutoReleasedObject(new CppFileSettingsPage(m_fileSettings)); - addAutoReleasedObject(new FindClassDeclarations(m_modelManager)); - addAutoReleasedObject(new FindFunctionCalls(m_modelManager)); - // Menus Core::ActionContainer *mtools = am->actionContainer(Core::Constants::M_TOOLS); Core::ActionContainer *mcpptools = am->createMenu(CppTools::Constants::M_TOOLS_CPP); |