diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2016-02-15 16:26:59 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2016-04-29 09:46:38 +0000 |
commit | 26e4943f7253e88ac0d05e9e9f9d18dd56982a0b (patch) | |
tree | bd2bba04f0487b6d172449e2de8d694118b40cbb | |
parent | 65ce4d61bcbedb8e937824c66efa119405fda9eb (diff) |
GenericHighlighter: Use new Utils::map for downloading definitions
Gets rid of the dummy callable object for QtConcurrent::map.
Change-Id: I306b238ed72f798b88c859e76def3f97c8ee1582
Reviewed-by: David Schulz <david.schulz@theqtcompany.com>
-rw-r--r-- | src/plugins/texteditor/generichighlighter/definitiondownloader.h | 11 | ||||
-rw-r--r-- | src/plugins/texteditor/generichighlighter/manager.cpp | 4 |
2 files changed, 2 insertions, 13 deletions
diff --git a/src/plugins/texteditor/generichighlighter/definitiondownloader.h b/src/plugins/texteditor/generichighlighter/definitiondownloader.h index f9010fd873..95ab812114 100644 --- a/src/plugins/texteditor/generichighlighter/definitiondownloader.h +++ b/src/plugins/texteditor/generichighlighter/definitiondownloader.h @@ -63,16 +63,5 @@ private: Status m_status; }; -// Currently QtConcurrent::map does not support passing member functions for sequence of pointers -// (only works for operator.*) which is the case for the downloaders held by the manager. Then the -// reason for the following functor. If something is implemented (for example a type traits) to -// handle operator->* in QtConcurrent::map this functor will not be necessary since it would be -// possible to directly pass DefinitionDownloader::run. -struct DownloaderStarter -{ - void operator()(DefinitionDownloader *downloader) - { downloader->run(); } -}; - } // namespace Internal } // namespace TextEditor diff --git a/src/plugins/texteditor/generichighlighter/manager.cpp b/src/plugins/texteditor/generichighlighter/manager.cpp index 1c08bfa01d..d5a2d62be3 100644 --- a/src/plugins/texteditor/generichighlighter/manager.cpp +++ b/src/plugins/texteditor/generichighlighter/manager.cpp @@ -37,7 +37,7 @@ #include <coreplugin/messagemanager.h> #include <coreplugin/progressmanager/progressmanager.h> #include <utils/algorithm.h> -#include <utils/QtConcurrentTools> +#include <utils/mapreduce.h> #include <utils/mimetypes/mimedatabase.h> #include <utils/networkaccessmanager.h> @@ -432,7 +432,7 @@ void MultiDefinitionDownloader::downloadDefinitions(const QList<QUrl> &urls) m_downloaders.append(downloader); } - QFuture<void> future = QtConcurrent::map(m_downloaders, DownloaderStarter()); + QFuture<void> future = Utils::map(m_downloaders, &DefinitionDownloader::run); m_downloadWatcher.setFuture(future); ProgressManager::addTask(future, tr("Downloading Highlighting Definitions"), "TextEditor.Task.Download"); |