[Interest] QWebView -> QWebSettings::enablePersistentStorage() unable to change directory

gsmember gs gsmember at hotmail.de
Wed Dec 25 21:49:42 CET 2013


Hello,
has nobody encountered the same issue?

I will try to explain it better:

I need to instanciate QWebView about 5 times.
After that I want that every instance has its own cache path (mostly cached images):

webView1->settings()->setIconDatabasePath(QDir::currentPath()+"/cache/1");
webView2->settings()->setIconDatabasePath(QDir::currentPath()+"/cache/2");
webView3->settings()->setIconDatabasePath(QDir::currentPath()+"/cache/3");
webView4->settings()->setIconDatabasePath(QDir::currentPath()+"/cache/4");
webView5->settings()->setIconDatabasePath(QDir::currentPath()+"/cache/5");

Everything (html, js...) is splitted up into the apprpriate directories except for icons and images. They were stored randomly in one of the above direcories in 
WebpageIcons.db in one place.

From: gsmember at hotmail.de
To: interest at qt-project.org
Date: Sun, 24 Nov 2013 22:26:35 +0100
Subject: [Interest] QWebView -> QWebSettings::enablePersistentStorage() unable to change directory




Hello,
I have a problem with QWebSettings and multipe QWebView's.

In my "MainWindow" class I create 4 instances of QWebView with exact the same settings, except for the path passed to enablePersistentStorage(path). The path is generated randomly.
After calling this the four QWebView werle loaded. But it seems that the "IconDatabasePath" does not change. The "WebpageIcons.db" (which holds the Icons) is only created in the directory of the first QWebView. I need to separate all files crated by QWebView and every Subclassess of this object.

My code (this piece of code is called four times, as mentioned above):

QWebview *webView=new QWebView();
cacheDirPath=QString::number(qrand());

webView->setPage(webPage);

webView->settings()->enablePersistentStorage(QDir::currentPath()+"/cache/"+cacheDirPath);
webView->load(request);

connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(slot_loadFinished()));



I have also tried to set the paths manually:
webView->settings()->setLocalStoragePath(QDir::currentPath()+"/cache/"+cacheDirPath);
webView->settings()->setOfflineStoragePath(QDir::currentPath()+"/cache/"+cacheDirPath);
webView->settings()->setIconDatabasePath(QDir::currentPath()+"/cache/"+cacheDirPath);
webView->settings()->setOfflineWebApplicationCachePath(QDir::currentPath()+"/cache/"+cacheDirPath);

Best regards,
_gs
 		 	   		  

_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20131225/36664fba/attachment.html>


More information about the Interest mailing list