<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hello,<br>has nobody encountered the same issue?<br><br>I will try to explain it better:<br><br>I need to instanciate QWebView about 5 times.<br>After that I want that every instance has its own cache path (mostly cached images):<br><br><span style=" color:#800000;">webView</span><span style=" color:#000000;">1-></span><span style=" color:#000000;">settings</span><span style=" color:#000000;">()-></span><span style=" color:#000000;">setIconDatabasePath</span><span style=" color:#000000;">(</span><span style=" color:#800080;">QDir</span><span style=" color:#000000;">::</span><span style=" color:#000000;">currentPath</span><span style=" color:#000000;">()+</span><span style=" color:#008000;">"/cache/1"</span><span style=" color:#000000;"></span><span style=" color:#800000;"></span><span style=" color:#000000;">);</span><br><span style=" color:#800000;">webView2</span><span style=" color:#000000;">-></span><span style=" color:#000000;">settings</span><span style=" color:#000000;">()-></span><span style=" color:#000000;">setIconDatabasePath</span><span style=" color:#000000;">(</span><span style=" color:#800080;">QDir</span><span style=" color:#000000;">::</span><span style=" color:#000000;">currentPath</span><span style=" color:#000000;">()+</span><span style=" color:#008000;">"/cache/2"</span><span style=" color:#000000;"></span><span style=" color:#800000;"></span><span style=" color:#000000;">);</span><br><span style=" color:#800000;">webView</span><span style=" color:#000000;">3-></span><span style=" color:#000000;">settings</span><span style=" color:#000000;">()-></span><span style=" color:#000000;">setIconDatabasePath</span><span style=" color:#000000;">(</span><span style=" color:#800080;">QDir</span><span style=" color:#000000;">::</span><span style=" color:#000000;">currentPath</span><span style=" color:#000000;">()+</span><span style=" color:#008000;">"/cache/3"</span><span style=" color:#000000;"></span><span style=" color:#800000;"></span><span style=" color:#000000;">);</span><br><span style=" color:#800000;">webView</span><span style=" color:#000000;">4-></span><span style=" color:#000000;">settings</span><span style=" color:#000000;">()-></span><span style=" color:#000000;">setIconDatabasePath</span><span style=" color:#000000;">(</span><span style=" color:#800080;">QDir</span><span style=" color:#000000;">::</span><span style=" color:#000000;">currentPath</span><span style=" color:#000000;">()+</span><span style=" color:#008000;">"/cache/4"</span><span style=" color:#000000;"></span><span style=" color:#800000;"></span><span style=" color:#000000;">);<br></span><span style=" color:#800000;">webView</span><span style=" color:#000000;">5-></span><span style=" color:#000000;">settings</span><span style=" color:#000000;">()-></span><span style=" color:#000000;">setIconDatabasePath</span><span style=" color:#000000;">(</span><span style=" color:#800080;">QDir</span><span style=" color:#000000;">::</span><span style=" color:#000000;">currentPath</span><span style=" color:#000000;">()+</span><span style=" color:#008000;">"/cache/5"</span><span style=" color:#000000;"></span><span style=" color:#800000;"></span><span style=" color:#000000;">);<br><br>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 </span><br><span style=" color:#000000;">WebpageIcons.db in one place.<br><br></span><div><hr id="stopSpelling">From: gsmember@hotmail.de<br>To: interest@qt-project.org<br>Date: Sun, 24 Nov 2013 22:26:35 +0100<br>Subject: [Interest] QWebView -> QWebSettings::enablePersistentStorage() unable to change directory<br><br>

<style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}

.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}

--></style>
<div dir="ltr">Hello,<br>I have a problem with QWebSettings and multipe QWebView's.<br><br>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.<br>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.<br><br>My code (this piece of code is called four times, as mentioned above):<br><br>QWebview *webView=new QWebView();<br>cacheDirPath=QString::number(qrand());<br><br>webView->setPage(webPage);<br><br>webView->settings()->enablePersistentStorage(QDir::currentPath()+"/cache/"+cacheDirPath);<br>webView->load(request);<br><br>connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(slot_loadFinished()));<br><br><br><br>I have also tried to set the paths manually:<br>webView->settings()->setLocalStoragePath(QDir::currentPath()+"/cache/"+cacheDirPath);<br>webView->settings()->setOfflineStoragePath(QDir::currentPath()+"/cache/"+cacheDirPath);<br>webView->settings()->setIconDatabasePath(QDir::currentPath()+"/cache/"+cacheDirPath);<br>webView->settings()->setOfflineWebApplicationCachePath(QDir::currentPath()+"/cache/"+cacheDirPath);<br><br>Best regards,<br>_gs<br>                                      </div>
<br>_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest</div>                                         </div></body>
</html>