forked from qt-creator/qt-creator
Move advanced search dialog into search result pane.
And move the cancel button into the specific search result widget. Change-Id: Ide8173e1ec5de091e1c1332a2b0c47d9a30a4c87 Reviewed-on: http://codereview.qt-project.org/4555 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
@@ -274,7 +274,7 @@ void CppFindReferences::findAll_helper(Symbol *symbol, const LookupContext &cont
|
||||
|
||||
result = QtConcurrent::run(&find_helper, workingCopy, context, this, symbol);
|
||||
m_watcher.setFuture(result);
|
||||
|
||||
connect(m_currentSearch, SIGNAL(cancelled()), this, SLOT(cancel()));
|
||||
Core::FutureProgress *progress = progressManager->addTask(result, tr("Searching"),
|
||||
CppTools::Constants::TASK_SEARCH);
|
||||
|
||||
@@ -310,6 +310,11 @@ void CppFindReferences::searchFinished()
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void CppFindReferences::cancel()
|
||||
{
|
||||
m_watcher.cancel();
|
||||
}
|
||||
|
||||
void CppFindReferences::openEditor(const Find::SearchResultItem &item)
|
||||
{
|
||||
if (item.path.size() > 0) {
|
||||
@@ -439,6 +444,7 @@ void CppFindReferences::findMacroUses(const Macro ¯o)
|
||||
QFuture<Usage> result;
|
||||
result = QtConcurrent::run(&findMacroUses_helper, workingCopy, snapshot, this, macro);
|
||||
m_watcher.setFuture(result);
|
||||
connect(m_currentSearch, SIGNAL(cancelled()), this, SLOT(cancel()));
|
||||
|
||||
Core::ProgressManager *progressManager = Core::ICore::instance()->progressManager();
|
||||
Core::FutureProgress *progress = progressManager->addTask(result, tr("Searching"),
|
||||
|
||||
@@ -83,6 +83,7 @@ public:
|
||||
private Q_SLOTS:
|
||||
void displayResults(int first, int last);
|
||||
void searchFinished();
|
||||
void cancel();
|
||||
void openEditor(const Find::SearchResultItem &item);
|
||||
void onReplaceButtonClicked(const QString &text, const QList<Find::SearchResultItem> &items);
|
||||
|
||||
|
||||
@@ -135,11 +135,6 @@ bool SymbolsFindFilter::isEnabled() const
|
||||
return !m_isRunning && m_enabled;
|
||||
}
|
||||
|
||||
bool SymbolsFindFilter::canCancel() const
|
||||
{
|
||||
return m_isRunning;
|
||||
}
|
||||
|
||||
void SymbolsFindFilter::cancel()
|
||||
{
|
||||
m_watcher.cancel();
|
||||
@@ -174,6 +169,7 @@ void SymbolsFindFilter::findAll(const QString &txt, Find::FindFlags findFlags)
|
||||
Find::FindFlags, CPlusPlus::Snapshot,
|
||||
SearchSymbols *, QSet<QString> >(runSearch, txt, findFlags, m_manager->snapshot(),
|
||||
&m_search, projectFileNames));
|
||||
connect(m_currentSearch, SIGNAL(cancelled()), this, SLOT(cancel()));
|
||||
Core::ICore::instance()->progressManager()->addTask(m_watcher.future(),
|
||||
tr("Searching"),
|
||||
Find::Constants::TASK_SEARCH);
|
||||
|
||||
@@ -63,8 +63,6 @@ public:
|
||||
QString id() const;
|
||||
QString displayName() const;
|
||||
bool isEnabled() const;
|
||||
bool canCancel() const;
|
||||
void cancel();
|
||||
Find::FindFlags supportedFindFlags() const;
|
||||
|
||||
void findAll(const QString &txt, Find::FindFlags findFlags);
|
||||
@@ -87,6 +85,7 @@ private slots:
|
||||
|
||||
void addResults(int begin, int end);
|
||||
void finish();
|
||||
void cancel();
|
||||
void onTaskStarted(const QString &type);
|
||||
void onAllTasksFinished(const QString &type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user