Continued porting the web browser. QtWebEngine

Thu, 25 Feb 2016 20:00:37 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 25 Feb 2016 20:00:37 +0100
branch
QtWebEngine
changeset 4773
cad470dfd807
parent 4772
db71b47b663e
child 4774
2c6ffa778c3b

Continued porting the web browser.

- added code to clean the caches

WebBrowser/WebBrowserWindow.py file | annotate | diff | comparison | revisions
--- a/WebBrowser/WebBrowserWindow.py	Thu Feb 25 19:29:09 2016 +0100
+++ b/WebBrowser/WebBrowserWindow.py	Thu Feb 25 20:00:37 2016 +0100
@@ -14,6 +14,7 @@
     pass
 
 import os
+import shutil
 
 from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt, QByteArray, QSize, QTimer, \
     QUrl, QThread, QTextCodec
@@ -56,7 +57,7 @@
 from .data import javascript_rc     # __IGNORE_WARNING__
 
 
-from .Tools import Scripts, WebBrowserTools, WebIconProvider
+from .Tools import Scripts, WebBrowserTools, WebIconProvider, WebBrowserPaths
 
 from .ZoomManager import ZoomManager
 
@@ -3293,12 +3294,10 @@
                 self.downloadManager().hide()
             if favicons:
                 self.__clearIconsDatabase()
-            # TODO: Cache Cleaning
-##            if cache:
-##                try:
-##                    self.networkManager().cache().clear()
-##                except AttributeError:
-##                    pass
+            if cache:
+                cachePath = self.webProfile().cachePath()
+                if cachePath:
+                    shutil.rmtree(cachePath)
             # TODO: Cookies
 ##            if cookies:
 ##                self.cookieJar().clear()

eric ide

mercurial