[Webkit-unassigned] [Bug 35671] New: [Qt] Even if QNetworkRequest::AlwaysCache is set on a request, a page will be loaded from the network the first time
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Mar 3 04:00:59 PST 2010
https://bugs.webkit.org/show_bug.cgi?id=35671
Summary: [Qt] Even if QNetworkRequest::AlwaysCache is set on a
request, a page will be loaded from the network the
first time
Product: WebKit
Version: 528+ (Nightly build)
Platform: Other
OS/Version: Mac OS X 10.5
Status: NEW
Keywords: Qt
Severity: Normal
Priority: P2
Component: New Bugs
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: vestbo at webkit.org
This bug report originated from issue QTBUG-4839
http://bugreports.qt.nokia.com/browse/QTBUG-4839
--- Description ---
The following example (whole example in the attachment) will load the page from
the network even if QNetworkRequest::AlwaysCache is set. the documentation says
"only load from cache, indicating error if the item was not cached (i.e.,
off-line mode)":
<div class="code panel" style="border-width: 1px;"><div class="codeContent
panelContent">
<pre class="code-java">QWebPage *webPage = ui->webView->page();
QNetworkAccessManager *netAccessMgr = <span class="code-keyword">new</span>
QNetworkAccessManager(<span class="code-keyword">this</span>);
QNetworkDiskCache *dc = <span class="code-keyword">new</span>
QNetworkDiskCache(<span class="code-keyword">this</span>);
dc->setCacheDirectory(<span class="code-quote">"cache"</span>);
netAccessMgr->setCache(dc);
webPage->setNetworkAccessManager(netAccessMgr);
QNetworkRequest *request = <span class="code-keyword">new</span>
QNetworkRequest(QUrl(ui->lineEdit->text()));
request->setAttribute(QNetworkRequest::CacheLoadControlAttribute,
QNetworkRequest::AlwaysCache);
ui->webView->load(*request);</pre>
</div></div>
--- Comments ---
Do we have an AlwaysCache autotest?
Yes, we do have a test. This is not a QNetworkAccessManager issue. It's a
QWebFrame issue, that doesn't honour the attributes set in the request.
PS: your sample code leaks the QNetworkRequest. Don't use "new".
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list