Commit be4e2c1a authored by Eike Ziller's avatar Eike Ziller
Browse files

Simplify code.



Change-Id: I4eef170f036a26c8ea8c3700c5524f7afedf67ac
Reviewed-by: default avatarLeandro Melo <leandro.melo@nokia.com>
parent 44f66959
......@@ -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);
......
......@@ -105,7 +105,6 @@ private:
void runNewSearch(const QString &txt, Find::FindFlags findFlags,
Find::SearchResultWindow::SearchMode searchMode);
void runSearch(Find::SearchResult *search);
QFutureWatcher<Utils::FileSearchResultList> *watcherForSearch(Find::SearchResult *search);
QMap<QFutureWatcher<Utils::FileSearchResultList> *, QPointer<Find::SearchResult> > m_watchers;
QPointer<Find::IFindSupport> m_currentFindSupport;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment