diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2014-11-18 15:49:27 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2014-11-18 16:21:36 +0100 |
commit | 1f411319e4bb849487a85e8ea051b94417372ff4 (patch) | |
tree | 2441e1e371beffba129d7a8e8303eeabf3ff911a /src/libs/installer/downloadfiletask.h | |
parent | 6df883de4ae674a9b351f04e74c80bfa89d5faa6 (diff) |
Ask for proxy credentials in modal dialog
If a proxy requires authentication, DownloadFileTask will throw an
exception of type ProxyAuthenticationRequiredException. This exception
is handled in MetadataJob to first ask the user for credentials,
storing them in PackageManagerProxyFactory, and then retriggering
the download.
Change-Id: I0d69504d3f90d503d83c7b2229bc670756fa1463
GPush-Base: 9aeb0197e58d630ef7e657bb05671d6ec7b3f5ec
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/downloadfiletask.h')
-rw-r--r-- | src/libs/installer/downloadfiletask.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libs/installer/downloadfiletask.h b/src/libs/installer/downloadfiletask.h index 3ad972763..6b3ddf24e 100644 --- a/src/libs/installer/downloadfiletask.h +++ b/src/libs/installer/downloadfiletask.h @@ -50,6 +50,22 @@ enum }; } +class ProxyAuthenticationRequiredException : public FileTaskException +{ +public: + ProxyAuthenticationRequiredException(const QNetworkProxy &proxy); + ~ProxyAuthenticationRequiredException() throw() {} + + QNetworkProxy proxy() const { return m_proxy; } + + void raise() const { throw *this; } + ProxyAuthenticationRequiredException *clone() const { + return new ProxyAuthenticationRequiredException(*this); } + +private: + QNetworkProxy m_proxy; +}; + class INSTALLER_EXPORT DownloadFileTask : public AbstractFileTask { Q_OBJECT |