[webkit-dev] Doubts on QNetworkAccessManager

Benjamin Meyer ben at meyerhome.net
Fri Nov 7 13:19:46 PST 2008

On Nov 3, 2008, at 11:34 AM, André Pedralho wrote:

> Hi all,
> I'm using the new QNetworkAccessManager to set my QtWebkit browser  
> cache
> system and realized that I can have more than one QWebPage loaded  
> and then
> (I guess) more than one QNetworkAccessManager as well.
> What happens when I call, for example, something like
> page[1].networkAccessManager().cache().clear() ?

That cache object that the network access manager has a pointer to is  

> Will it clear all the cache or just the cache related the page[1]?

The default NetworkCache objects do not know about each other so only  
one cache object is cleared.

> Wouldn't be better to have this kind of functionalities in the  
> QWebView
> class? Maybe something like QWebSettings. Actually, IMHO we could have
> access to the cache settings from QWebSettings.

QWebSettings is for settings, not to hold cache objects

> Is there any other way to clear the cache?

Using the clear function on the cache is the proper way.  What you are  
probably looking for is to share the same network access manager with  
all your pages.  Then you only have one cache.  For an example of this  
checkout the source code for Arora.

-Benjamin Meyer

More information about the webkit-dev mailing list