Added a QWebNetworkRequest::init overload that takes a WebCore::ResourceRequest,
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jun 2007 13:49:34 +0000 (13:49 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Jun 2007 13:49:34 +0000 (13:49 +0000)
to be called from FrameLoaderClientQt in the near future.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@22094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKitQt/Api/qwebnetworkinterface.cpp
WebKitQt/Api/qwebnetworkinterface_p.h
WebKitQt/ChangeLog

index 41450882d833fc56ab405153a983bdec4fd3623a..bad274b78bbe5c4ee8f125bf529d3d28876db486 100644 (file)
@@ -56,6 +56,13 @@ static bool operator==(const HostInfo &i1, const HostInfo &i2)
     return i1.port == i2.port && i1.host == i2.host;
 }
 
+void QWebNetworkRequest::init(const WebCore::ResourceRequest &resourceRequest)
+{
+    KURL url = resourceRequest.url();
+    QUrl qurl = QString(url.url());
+    init(resourceRequest.httpMethod(), qurl, &resourceRequest);
+}
+
 void QWebNetworkRequest::init(const QString &method, const QUrl &url, const WebCore::ResourceRequest *resourceRequest)
 {
     request = QHttpRequestHeader(method, url.toEncoded(QUrl::RemoveScheme|QUrl::RemoveAuthority));
@@ -245,9 +252,7 @@ bool QWebNetworkManager::add(ResourceHandle *handle, QWebNetworkInterface *inter
     job->d->interface = interface;
     job->d->connector = 0;
 
-    KURL url = handle->url();
-    QUrl qurl = QString(url.url());
-    job->d->init(handle->method(), qurl, &handle->request());
+    job->d->init(handle->request());
 
     if (handle->method() != "POST" && handle->method() != "GET") {
         // don't know what to do! (probably a request error!!)
index e68f334f7964d92c39cf8311a70bfc66da4eb6c7..3ebe01b4daa14922866572860907f8b099c83e06 100644 (file)
@@ -42,6 +42,7 @@ struct QWebNetworkRequest
     QHttpRequestHeader request;
     QByteArray postData;
 
+    void init(const WebCore::ResourceRequest &resourceRequest);
     void init(const QString &method, const QUrl &url, const WebCore::ResourceRequest *resourceRequest = 0);
     void setURL(const QUrl &u);
 };
index bd497449e4d26224474b624e59a473888cacf121..e066e62f51e530baeca6fdd81428a275c2870ee1 100644 (file)
@@ -1,3 +1,14 @@
+2007-06-11  Simon Hausmann  <hausmann@kde.org>
+
+        Reviewed by Lars.
+
+        Added a QWebNetworkRequest::init overload that takes a WebCore::ResourceRequest,
+        to be called from FrameLoaderClientQt in the near future.
+
+        * Api/qwebnetworkinterface.cpp:
+        (QWebNetworkManager::add):
+        * Api/qwebnetworkinterface_p.h:
+
 2007-06-11  Simon Hausmann  <hausmann@kde.org>
 
         Reviewed by Lars.