Added a QWebNetworkRequest convenience constructor.
authorhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2007 13:05:01 +0000 (13:05 +0000)
committerhausmann <hausmann@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jun 2007 13:05:01 +0000 (13:05 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@23498 268f45cc-cd09-0410-ab3c-d52691b4dbfc

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

index 38a04d9bb28c27ecaeaec9976c50e4c740468bd4..32800e0144ddf08bfa36b0f721f949425db1cfcf 100644 (file)
@@ -118,6 +118,13 @@ QWebNetworkRequest::QWebNetworkRequest()
 {
 }
 
+QWebNetworkRequest::QWebNetworkRequest(const QUrl &url, Method method, const QByteArray &postData)
+    : d(new QWebNetworkRequestPrivate)
+{
+    d->init(method == Get ? "GET" : "POST", url);
+    d->postData = postData;
+}
+
 QWebNetworkRequest::QWebNetworkRequest(const QWebNetworkRequest &other)
     : d(new QWebNetworkRequestPrivate(*other.d))
 {
index 3bf5402d97287ac03cfc7a368b21b49f141697b2..46fb21e524f08e747d379173e611efec40b8df58 100644 (file)
@@ -50,6 +50,7 @@ public:
     };
 
     QWebNetworkRequest();
+    explicit QWebNetworkRequest(const QUrl &url, Method method = Get, const QByteArray &postData = QByteArray());
     QWebNetworkRequest(const QWebNetworkRequest &other);
 
     QWebNetworkRequest &operator=(const QWebNetworkRequest &other);
index b100542ec6e49a90b4cc04bb2692c44eac135d1d..cd741866fe43148d5c187a904185c442fea207b4 100644 (file)
@@ -131,9 +131,7 @@ QWebFrame *QWebPage::createFrame(QWebFrame *parentFrame, QWebFrameData *frameDat
 
 void QWebPage::open(const QUrl &url)
 {
-    QWebNetworkRequest request;
-    request.setUrl(url);
-    open(request);
+    open(QWebNetworkRequest(url));
 }
 
 void QWebPage::open(const QWebNetworkRequest &req)
index 7b6f0b04a72536494f84687c9eb85bffd1c4708b..d48fbfea7a9e3cae715e7bef7d2cf158c4d11747 100644 (file)
@@ -1,3 +1,14 @@
+2007-06-13  Simon Hausmann  <hausmann@kde.org>
+
+        Reviewed by Lars.
+
+        Added a QWebNetworkRequest convenience constructor.
+
+        * Api/qwebnetworkinterface.cpp:
+        * Api/qwebnetworkinterface.h:
+        * Api/qwebpage.cpp:
+        (QWebPage::open):
+
 2007-06-13  Simon Hausmann  <hausmann@kde.org>
 
         Reviewed by Lars.