diff options
author | Leandro Melo <leandro.melo@nokia.com> | 2010-08-04 15:29:02 +0200 |
---|---|---|
committer | Leandro Melo <leandro.melo@nokia.com> | 2010-08-04 15:40:20 +0200 |
commit | 6c73fb8f71e1dbcc0b0a5483400d6602a0a649e6 (patch) | |
tree | 3676b9845ed03feb73d68dad2549063c1d1f7f68 /src/plugins/texteditor/generichighlighter/definitiondownloader.h | |
parent | 28247894bd1f74b9db239752c87ba71cc6d3a8ca (diff) |
Improve user interface of manage definitions dialog.
Task-number: QTCREATORBUG-1886
Diffstat (limited to 'src/plugins/texteditor/generichighlighter/definitiondownloader.h')
-rw-r--r-- | src/plugins/texteditor/generichighlighter/definitiondownloader.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/plugins/texteditor/generichighlighter/definitiondownloader.h b/src/plugins/texteditor/generichighlighter/definitiondownloader.h index c2866183c7..67fc7c955a 100644 --- a/src/plugins/texteditor/generichighlighter/definitiondownloader.h +++ b/src/plugins/texteditor/generichighlighter/definitiondownloader.h @@ -48,25 +48,34 @@ class DefinitionDownloader : public QObject public: DefinitionDownloader(const QUrl &url, const QString &localPath); - void start(); + enum Status { + NetworkError, + WriteError, + Ok, + Unknown + }; + + void run(); + Status status() const; private: QNetworkReply *getData(QNetworkAccessManager *manager) const; - void saveData(QNetworkReply *reply) const; + void saveData(QNetworkReply *reply); QUrl m_url; QString m_localPath; + 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::start. +// possible to directly pass DefinitionDownloader::run. struct DownloaderStarter { void operator()(DefinitionDownloader *downloader) - { downloader->start(); } + { downloader->run(); } }; } // namespace Internal |