forked from qt-creator/qt-creator
Simplify code.
Change-Id: I4eef170f036a26c8ea8c3700c5524f7afedf67ac Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
@@ -86,7 +86,7 @@ void BaseFileFind::cancel()
|
|||||||
{
|
{
|
||||||
SearchResult *search = qobject_cast<SearchResult *>(sender());
|
SearchResult *search = qobject_cast<SearchResult *>(sender());
|
||||||
QTC_ASSERT(search, return);
|
QTC_ASSERT(search, return);
|
||||||
QFutureWatcher<FileSearchResultList> *watcher = watcherForSearch(search);
|
QFutureWatcher<FileSearchResultList> *watcher = m_watchers.key(search);
|
||||||
QTC_ASSERT(watcher, return);
|
QTC_ASSERT(watcher, return);
|
||||||
watcher->cancel();
|
watcher->cancel();
|
||||||
}
|
}
|
||||||
@@ -164,19 +164,6 @@ void BaseFileFind::runSearch(Find::SearchResult *search)
|
|||||||
connect(progress, SIGNAL(clicked()), Find::SearchResultWindow::instance(), SLOT(popup()));
|
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)
|
void BaseFileFind::findAll(const QString &txt, Find::FindFlags findFlags)
|
||||||
{
|
{
|
||||||
runNewSearch(txt, findFlags, SearchResultWindow::SearchOnly);
|
runNewSearch(txt, findFlags, SearchResultWindow::SearchOnly);
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ private:
|
|||||||
void runNewSearch(const QString &txt, Find::FindFlags findFlags,
|
void runNewSearch(const QString &txt, Find::FindFlags findFlags,
|
||||||
Find::SearchResultWindow::SearchMode searchMode);
|
Find::SearchResultWindow::SearchMode searchMode);
|
||||||
void runSearch(Find::SearchResult *search);
|
void runSearch(Find::SearchResult *search);
|
||||||
QFutureWatcher<Utils::FileSearchResultList> *watcherForSearch(Find::SearchResult *search);
|
|
||||||
|
|
||||||
QMap<QFutureWatcher<Utils::FileSearchResultList> *, QPointer<Find::SearchResult> > m_watchers;
|
QMap<QFutureWatcher<Utils::FileSearchResultList> *, QPointer<Find::SearchResult> > m_watchers;
|
||||||
QPointer<Find::IFindSupport> m_currentFindSupport;
|
QPointer<Find::IFindSupport> m_currentFindSupport;
|
||||||
|
|||||||
Reference in New Issue
Block a user