Changeset 58426 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 27, 2015 11:59:56 AM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 103683
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/net
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloader.cpp
r58423 r58426 43 43 44 44 /* Send HEAD requests: */ 45 QList<QNetworkRequest> requests; 46 for (int i = 0; i < m_sources.size(); ++i) 47 requests << QNetworkRequest(m_sources[i]); 48 49 /* Create network request set: */ 50 createNetworkRequest(UINetworkRequestType_HEAD, requests); 45 createNetworkRequest(UINetworkRequestType_HEAD, m_sources); 51 46 } 52 47 … … 58 53 59 54 /* Send GET request: */ 60 QNetworkRequest request(m_source); 61 62 /* Create network request: */ 63 createNetworkRequest(UINetworkRequestType_GET, QList<QNetworkRequest>() << request); 55 createNetworkRequest(UINetworkRequestType_GET, QList<QUrl>() << m_source); 64 56 } 65 57 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.cpp
r58425 r58426 21 21 22 22 /* Qt includes: */ 23 # include <Q NetworkRequest>23 # include <QUrl> 24 24 25 25 /* Local includes: */ … … 42 42 } 43 43 44 void UINetworkCustomer::createNetworkRequest(UINetworkRequestType type, const QList<Q NetworkRequest> requests,44 void UINetworkCustomer::createNetworkRequest(UINetworkRequestType type, const QList<QUrl> urls, 45 45 const UserDictionary requestHeaders /* = UserDictionary() */) 46 46 { 47 gNetworkManager->createNetworkRequest(type, requests, requestHeaders, this);47 gNetworkManager->createNetworkRequest(type, urls, requestHeaders, this); 48 48 } 49 49 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.h
r58425 r58426 27 27 /* Forward declarations: */ 28 28 class UINetworkReply; 29 class Q NetworkRequest;29 class QUrl; 30 30 31 31 /* Interface to access UINetworkManager protected functionality: */ … … 55 55 protected: 56 56 57 /** Creates network-request of the passed @a type on the basis of the passed @a requests and the @a requestHeaders. */58 void createNetworkRequest(UINetworkRequestType type, const QList<Q NetworkRequest> requests,57 /** Creates network-request of the passed @a type on the basis of the passed @a urls and the @a requestHeaders. */ 58 void createNetworkRequest(UINetworkRequestType type, const QList<QUrl> urls, 59 59 const UserDictionary requestHeaders = UserDictionary()); 60 60 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.cpp
r58425 r58426 22 22 /* Global includes: */ 23 23 # include <QWidget> 24 # include <QUrl> 24 25 25 26 /* Local includes: */ … … 107 108 } 108 109 109 void UINetworkManager::createNetworkRequest(UINetworkRequestType type, const QList<Q NetworkRequest> &requests,110 void UINetworkManager::createNetworkRequest(UINetworkRequestType type, const QList<QUrl> &urls, 110 111 const UserDictionary &requestHeaders, UINetworkCustomer *pCustomer) 111 112 { 112 113 /* Create network-request: */ 113 UINetworkRequest *pNetworkRequest = new UINetworkRequest(type, requests, requestHeaders, pCustomer, this);114 UINetworkRequest *pNetworkRequest = new UINetworkRequest(type, urls, requestHeaders, pCustomer, this); 114 115 /* Prepare created network-request: */ 115 116 prepareNetworkRequest(pNetworkRequest); -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.h
r58425 r58426 19 19 #define __UINetworkManager_h__ 20 20 21 /* Globalincludes: */21 /* Qt includes: */ 22 22 #include <QNetworkAccessManager> 23 23 #include <QUuid> 24 #include <QMap>25 #include <QNetworkRequest>26 24 27 25 /* Local inludes: */ … … 29 27 30 28 /* Forward declarations: */ 29 class QUrl; 31 30 class QWidget; 32 31 class UINetworkRequest; … … 82 81 friend class UINetworkCustomer; 83 82 /** Creates network-request of the passed @a type 84 * on the basis of the passed @a requests and the @a requestHeaders for the @a pCustomer specified. */85 void createNetworkRequest(UINetworkRequestType type, const QList<Q NetworkRequest> &requests,83 * on the basis of the passed @a urls and the @a requestHeaders for the @a pCustomer specified. */ 84 void createNetworkRequest(UINetworkRequestType type, const QList<QUrl> &urls, 86 85 const UserDictionary &requestHeaders, UINetworkCustomer *pCustomer); 87 86 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.cpp
r58425 r58426 26 26 # include <QRegExp> 27 27 # include <QVector> 28 # include <QVariant> 28 29 29 30 /* GUI includes: */ … … 70 71 public: 71 72 72 /** Constructs network-reply thread of the passed @a type for the passed @a requestand @a requestHeaders. */73 UINetworkReplyPrivateThread(UINetworkRequestType type, const Q NetworkRequest &request, const UserDictionary &requestHeaders);73 /** Constructs network-reply thread of the passed @a type for the passed @a url and @a requestHeaders. */ 74 UINetworkReplyPrivateThread(UINetworkRequestType type, const QUrl &url, const UserDictionary &requestHeaders); 74 75 75 76 /** @name APIs … … 79 80 80 81 /** Returns the URL of the reply which is the URL of the request for now. */ 81 QUrl url() const { return m_request.url(); }82 const QUrl& url() const { return m_url; } 82 83 83 84 /** Returns the last cached IPRT HTTP error of the reply. */ … … 190 191 /** Holds the request type. */ 191 192 const UINetworkRequestType m_type; 192 /** Holds the request instance. */193 const Q NetworkRequest m_request;193 /** Holds the request url. */ 194 const QUrl m_url; 194 195 /** Holds the request headers. */ 195 196 const UserDictionary m_requestHeaders; … … 204 205 QByteArray m_reply; 205 206 /** Holds the cached reply headers. */ 206 QMap<QString, QString>m_headers;207 UserDictionary m_headers; 207 208 208 209 /** Holds the URLs to root zip files containing certificates we want. */ … … 243 244 public: 244 245 245 /** Constructs network-reply private data of the passed @a type for the passed @a requestand @a requestHeaders. */246 UINetworkReplyPrivate(UINetworkRequestType type, const Q NetworkRequest &request, const UserDictionary &requestHeaders);246 /** Constructs network-reply private data of the passed @a type for the passed @a url and @a requestHeaders. */ 247 UINetworkReplyPrivate(UINetworkRequestType type, const QUrl &url, const UserDictionary &requestHeaders); 247 248 /** Destructs reply private data. */ 248 249 ~UINetworkReplyPrivate(); … … 343 344 const QString UINetworkReplyPrivateThread::s_strCertificateFileName = QString("vbox-ssl-cacertificate.crt"); 344 345 345 UINetworkReplyPrivateThread::UINetworkReplyPrivateThread(UINetworkRequestType type, const Q NetworkRequest &request, const UserDictionary &requestHeaders)346 UINetworkReplyPrivateThread::UINetworkReplyPrivateThread(UINetworkRequestType type, const QUrl &url, const UserDictionary &requestHeaders) 346 347 : m_type(type) 347 , m_ request(request)348 , m_url(url) 348 349 , m_requestHeaders(requestHeaders) 349 350 , m_hHttp(NIL_RTHTTP) … … 529 530 void *pvResponse = 0; 530 531 size_t cbResponse = 0; 531 rc = RTHttpGetHeaderBinary(m_hHttp, m_ request.url().toString().toUtf8().constData(), &pvResponse, &cbResponse);532 rc = RTHttpGetHeaderBinary(m_hHttp, m_url.toString().toUtf8().constData(), &pvResponse, &cbResponse); 532 533 if (RT_SUCCESS(rc)) 533 534 { … … 556 557 void *pvResponse = 0; 557 558 size_t cbResponse = 0; 558 rc = RTHttpGetBinary(m_hHttp, m_ request.url().toString().toUtf8().constData(), &pvResponse, &cbResponse);559 rc = RTHttpGetBinary(m_hHttp, m_url.toString().toUtf8().constData(), &pvResponse, &cbResponse); 559 560 if (RT_SUCCESS(rc)) 560 561 { … … 919 920 *********************************************************************************************************************************/ 920 921 921 UINetworkReplyPrivate::UINetworkReplyPrivate(UINetworkRequestType type, const Q NetworkRequest &request, const UserDictionary &requestHeaders)922 UINetworkReplyPrivate::UINetworkReplyPrivate(UINetworkRequestType type, const QUrl &url, const UserDictionary &requestHeaders) 922 923 : m_error(UINetworkReply::NoError) 923 924 , m_pThread(0) … … 927 928 928 929 /* Create and run reply thread: */ 929 m_pThread = new UINetworkReplyPrivateThread(type, request, requestHeaders);930 m_pThread = new UINetworkReplyPrivateThread(type, url, requestHeaders); 930 931 connect(m_pThread, SIGNAL(sigDownloadProgress(qint64, qint64)), 931 932 this, SIGNAL(downloadProgress(qint64, qint64)), Qt::QueuedConnection); … … 992 993 *********************************************************************************************************************************/ 993 994 994 UINetworkReply::UINetworkReply(UINetworkRequestType type, const Q NetworkRequest &request, const UserDictionary &requestHeaders)995 : m_pReply(new UINetworkReplyPrivate(type, request, requestHeaders))995 UINetworkReply::UINetworkReply(UINetworkRequestType type, const QUrl &url, const UserDictionary &requestHeaders) 996 : m_pReply(new UINetworkReplyPrivate(type, url, requestHeaders)) 996 997 { 997 998 /* Prepare network-reply object connections: */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkReply.h
r58425 r58426 21 21 /* Qt includes: */ 22 22 #include <QPointer> 23 #include <Q NetworkReply>23 #include <QUrl> 24 24 25 25 /* GUI includes: */ … … 84 84 }; 85 85 86 /** Constructs network-reply of the passed @a type for the passed @a requestand @a requestHeaders. */87 UINetworkReply(UINetworkRequestType type, const Q NetworkRequest &request, const UserDictionary &requestHeaders);86 /** Constructs network-reply of the passed @a type for the passed @a url and @a requestHeaders. */ 87 UINetworkReply(UINetworkRequestType type, const QUrl &url, const UserDictionary &requestHeaders); 88 88 /** Destructs reply. */ 89 89 ~UINetworkReply(); -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.cpp
r58425 r58426 20 20 #else /* !VBOX_WITH_PRECOMPILED_HEADERS */ 21 21 22 /* Qt includes: */23 # include <QNetworkReply>24 25 22 /* GUI includes: */ 26 23 # include "UINetworkRequest.h" … … 36 33 37 34 UINetworkRequest::UINetworkRequest(UINetworkRequestType type, 38 const QList<Q NetworkRequest> &requests,35 const QList<QUrl> &urls, 39 36 const UserDictionary &requestHeaders, 40 37 UINetworkCustomer *pCustomer, … … 43 40 , m_type(type) 44 41 , m_uuid(QUuid::createUuid()) 45 , m_requests( requests)42 , m_requests(urls) 46 43 , m_requestHeaders(requestHeaders) 47 44 , m_iCurrentRequestIndex(0) … … 109 106 110 107 /* Choose redirect-source as current: */ 111 m_request .setUrl(redirect);108 m_request = redirect; 112 109 113 110 /* Create new network-reply finally: */ … … 131 128 cleanupNetworkReply(); 132 129 133 /* Choose next network-requestas current: */130 /* Choose next url as current: */ 134 131 ++m_iCurrentRequestIndex; 135 m_request = m_requests [m_iCurrentRequestIndex];132 m_request = m_requests.at(m_iCurrentRequestIndex); 136 133 137 134 /* Create new network-reply finally: */ … … 154 151 cleanupNetworkReply(); 155 152 156 /* Choose first network-requestas current: */153 /* Choose first url as current: */ 157 154 m_iCurrentRequestIndex = 0; 158 m_request = m_requests [m_iCurrentRequestIndex];155 m_request = m_requests.at(m_iCurrentRequestIndex); 159 156 160 157 /* Create new network-reply finally: */ … … 178 175 manager()->registerNetworkRequest(this); 179 176 180 /* Choose first network-requestas current: */177 /* Choose first url as current: */ 181 178 m_iCurrentRequestIndex = 0; 182 m_request = m_requests [m_iCurrentRequestIndex];179 m_request = m_requests.at(m_iCurrentRequestIndex); 183 180 184 181 /* Create network-reply: */ -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkRequest.h
r58425 r58426 21 21 /* Qt includes: */ 22 22 #include <QUuid> 23 #include <QNetworkRequest>24 23 #include <QPointer> 25 24 … … 58 57 59 58 /** Constructs network-request of the passed @a type 60 * on the basis of the passed @a requests and the @a requestHeaders59 * on the basis of the passed @a urls and the @a requestHeaders 61 60 * for the @a pCustomer and @a pNetworkManager specified. */ 62 61 UINetworkRequest(UINetworkRequestType type, 63 const QList<Q NetworkRequest> &requests,62 const QList<QUrl> &urls, 64 63 const UserDictionary &requestHeaders, 65 64 UINetworkCustomer *pCustomer, … … 103 102 UINetworkRequestType m_type; 104 103 QUuid m_uuid; 105 QList<Q NetworkRequest> m_requests;104 QList<QUrl> m_requests; 106 105 /** Holds the request headers. */ 107 106 const UserDictionary m_requestHeaders; 108 Q NetworkRequestm_request;107 QUrl m_request; 109 108 int m_iCurrentRequestIndex; 110 109 QString m_strDescription; -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp
r58425 r58426 196 196 197 197 /* Send GET request: */ 198 QNetworkRequest request;199 request.setUrl(url);200 198 UserDictionary headers; 201 199 headers["User-Agent"] = strUserAgent; 202 createNetworkRequest(UINetworkRequestType_GET, QList<Q NetworkRequest>() << request, headers);200 createNetworkRequest(UINetworkRequestType_GET, QList<QUrl>() << url, headers); 203 201 } 204 202 -
trunk/src/VBox/Frontends/VirtualBox/src/net/tstSSLCertDownloads.cpp
r58425 r58426 45 45 { 46 46 NOREF(hTest); 47 Q NetworkRequestDummy1;47 QUrl Dummy1; 48 48 UserDictionary Dummy2; 49 49 UINetworkReplyPrivateThread TestObj(UINetworkRequestType_GET, Dummy1, Dummy2);
Note:
See TracChangeset
for help on using the changeset viewer.