Simplify code.

Change-Id: I4eef170f036a26c8ea8c3700c5524f7afedf67ac
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
Eike Ziller
2011-12-14 13:26:33 +01:00
parent 44f66959a3
commit be4e2c1a77
2 changed files with 1 additions and 15 deletions

View File

@@ -86,7 +86,7 @@ void BaseFileFind::cancel()
{
SearchResult *search = qobject_cast<SearchResult *>(sender());
QTC_ASSERT(search, return);
QFutureWatcher<FileSearchResultList> *watcher = watcherForSearch(search);
QFutureWatcher<FileSearchResultList> *watcher = m_watchers.key(search);
QTC_ASSERT(watcher, return);
watcher->cancel();
}
@@ -164,19 +164,6 @@ void BaseFileFind::runSearch(Find::SearchResult *search)
connect(progress, SIGNAL(clicked()), Find::SearchResultWindow::instance(), SLOT(popup()));
}
QFutureWatcher<FileSearchResultList> *BaseFileFind::watcherForSearch(SearchResult *search)
{
if (!search)
return 0;
QMapIterator<QFutureWatcher<Utils::FileSearchResultList> *, QPointer<Find::SearchResult> > it(m_watchers);
while (it.hasNext()) {
it.next();
if (it.value() == search)
return it.key();
}
return 0;
}
void BaseFileFind::findAll(const QString &txt, Find::FindFlags findFlags)
{
runNewSearch(txt, findFlags, SearchResultWindow::SearchOnly);